File size: 1,196 Bytes
29b445b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
@echo off
echo Starting Image Tagger Application...



REM Store the parent directory path
set PARENT_DIR=%CD%



REM Change to the app directory
cd game



REM Check if the directory change was successful
if %ERRORLEVEL% NEQ 0 (
    echo ERROR: Could not change to app directory.
    pause
    exit /b 1
)



REM Check if run_game.py exists
if not exist run_game.py (
    echo ERROR: run_game.py file not found
    pause
    exit /b 1
)

echo Found run_game.py, preparing to run...



REM Activate virtual environment from the parent directory
if exist "%PARENT_DIR%\venv\Scripts\activate.bat" (
    echo Activating virtual environment from parent directory...
    call "%PARENT_DIR%\venv\Scripts\activate.bat"
) else (
    echo ERROR: Virtual environment not found at %PARENT_DIR%\venv\Scripts\activate.bat
    pause
    exit /b 1
)



REM Set PYTHONPATH to include parent directory for imports
set PYTHONPATH=%PARENT_DIR%;%PYTHONPATH%



REM Run the script with the path to streamlit from parent venv
"%PARENT_DIR%\venv\Scripts\python.exe" run_game.py



REM Deactivate virtual environment
call deactivate



REM Return to parent directory
cd ..

echo Done!
pause