I need to set up a long list of temporary environment variables every time when I start a Python Flask app on Windows 10. Now I would like to create a batch file to run with all settings in one double click. The following lines run well if I copy them and paste to cmd prompt, but I couldn't run them in the batch file.
The execution of batch file always gets tripped and exited at the 2nd line venvscriptsactivate
in the batch file, which has no issue at all if I copy and paste line by line at cmd.
cd C:pyproject
venvscriptsactivate
set env1=val1
set env2=val2
set FLASK_APP=some.py
flask run
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…