简体   繁体   中英

How to schedule python script run from anaconda?

I want every twenty minutes python script to be run from anaconda prompt. ie I want command:

python script.py --argument arg

to be run every twenty minutes. I saw package called schedule and that I can run python scripts via Task Manager but those things seem to be not suitable for my problem (Task Manager can run script.py every twenty minutes, but there is not option to provide my argument arg to it).

Could you please help me with doing so?

You can do it from a python script

import time

while True:
    os.system('python --argument arg')
    time.sleep(1800)
    

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM