hi i have a question how can run a python script in Batch file
i have a setup file for my flask app and every time should set up some environment variable and run app.py
i create a setup for this but i don't know how run python app and it's not working
my setup.cmd file looks like this:
set app_debug=True
set API_KEY=secret
set SECRET_KEY=development mode
set WTF_CSRF_SECRET_KEY=development mode
set email_password=development mode
set RECAPTCHA_PUBLIC_KEY=secret
set RECAPTCHA_PRIVATE_KEY=secret
./venv/Scripts/activate.bat
python app.py
and it's goes to ./venv/Scripts/activate.bat and then stop and don't work
./venv/Scripts/activate.bat
is wrong and correct would becall "%~dp0venv\Scripts\activate.bat"
which calls the batch fileactivate.bat
in subdirectoryScripts
in subdirectoryvenv
in the directory of the currently processed batch file independent on current directory, orcall ".\venv\Scripts\activate.bat"
or justcall venv\Scripts\activate.bat
to call the batch fileactivate.bat
in subdirectoryScripts
in subdirectoryvenv
in the current directory independent on batch file directory.