Search code examples
pythonanacondascheduled-tasks

How to schedule python script run from anaconda?


I want every twenty minutes python script to be run from anaconda prompt. i.e. 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?


Solution

  • You can do it from a python script

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