Task Scheduler with Python and Anaconda environment
Frequently, we as researchers would like to expedite our work process with programs when we have repeated tasks. There is an easy way for you to do this with Python on your Windows computer.
Steps:
- Create your python file:
file.py
- Create your bat file to call your environment and the python scrip:
file.bat
(typically we edit in “Notepad”)
call activate "C:\Users\user_name\Anaconda3\envs\envs_name"
python "C:\Users\...\file.py"
call conda deactivate
- Search for “Task Scheduler”
- On the right-hand side, you will see “Create Basic Task”
- Follow the steps until “Action”, pick “Start a program”
- Browse your
file.bat
and finish