-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.bat
executable file
·38 lines (29 loc) · 949 Bytes
/
settings.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
setlocal EnableDelayedExpansion
echo Checking for an installed Python version...
REM Check for Python 3 and capture the version output
for /f "delims=" %%i in ('python --version 2^>^&1') do set pyversion=%%i
REM Check if the version string contains "Python 3"
echo !pyversion! | findstr /C:"Python 3" > nul
if %errorlevel% == 0 (
echo Found installed Python: !pyversion!
set py=python
) else (
REM If Python 3 is not found, try finding python3 explicitly
where python3 >nul 2>&1
if %errorlevel% == 0 (
set py=python3
echo Using python3 as fallback
) else (
echo Python 3 is not installed. Please install Python 3.
exit /b 1
)
)
echo Activating the virtual environment...
call venv\Scripts\activate
REM Set the environment variable to force UTF-8 encoding
set PYTHONUTF8=1
echo Executing the settings script...
!py! settings.py
echo Script execution completed.
exit /b 0