Here's a little Python-related batch I use all the time as a practice for Qiita posts.
This batch is used when the command operation is troublesome and you want to execute it by double-clicking when executing the python file being edited, or when you want to start it with the task scheduler. If you save the following batch as "python file name you want to execute.bat", you can execute python by double-clicking.
PythonFile.bat
rem Move to batch storage folder
cd %~p0
Activate the rem conda environment
call activate scraping_env
rem batch file filename.Run py python file
python %~n0%.py
Wait when the rem Python script finishes
pause
Python file example
PythonFile.py
print("You can run the same python file as the batch name.")
Yeah, you don't need it if you associate it with an executable program! !!
The following is a setting that allows you to access Jupyter from another PC with a password. I have set the following batch in the task scheduler to be executed when the PC is started.
rem Go to work space
mkdir cd C:\Users\xxxxxx\Documents\PythonScript
cd C:\Users\xxxxxx\Documents\PythonScript
Activate the rem anaconda environment
call activate kaggle_env1
rem password (To-kun), how to use Jupiter without starting the browser
jupyter notebook --NotebookApp.token='password' --ip=* --no-browser
The content of this post ... Who will benefit ...
Recommended Posts