Cleaner code, it works pretty fine
This commit is contained in:
25
Run.cmd
Normal file
25
Run.cmd
Normal file
@@ -0,0 +1,25 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM Define paths
|
||||
set VENV_DIR=venv
|
||||
set APP_DIR=Program
|
||||
set PYTHON=%VENV_DIR%\Scripts\python.exe
|
||||
|
||||
REM Check for venv
|
||||
if not exist %VENV_DIR% (
|
||||
echo Creating virtual environment...
|
||||
python -m venv %VENV_DIR%
|
||||
echo Installing dependencies...
|
||||
%PYTHON% -m pip install --upgrade pip
|
||||
%PYTHON% -m pip install -r requirements.txt
|
||||
) else (
|
||||
echo Virtual environment found, assuming dependencies are satisfied.
|
||||
)
|
||||
|
||||
REM Run the app
|
||||
cd /d %~dp0%APP_DIR%
|
||||
..\%VENV_DIR%\Scripts\python.exe app.py
|
||||
|
||||
endlocal
|
||||
|
Reference in New Issue
Block a user