How to start python script by batch file on window
Reference
https://datatofish.com/batch-python-script/
Assumption
- Your python script is manage.py
- Create a batch file "run.bat" which is placed in the same directory with your python script.
run.bat source code
:: find python.exe path @for %%i in (python.exe) do @set py=%%~$PATH:i ::run main program %py% %CD%\manage.py ::wait for stop pause
manage.py source code
print("Surprisingly, The naughty kitten defeated a giant python")
Looking more sample batch file
https://www.robvanderwoude.com/batexamples.php
Comments
Post a Comment