Reputation: 1
I'm trying to run File.py script on Windows with module python cron tab. I have this code and it does not work.
tab = CronTab(tab="""
*/1 * * * * C:\Python27\python.exe C:\Python27\File.py
""")
cmd = 'C:\Python27\python.exe C:\Python27\File.py'
# You can even set a comment for this command
cron_job = tab.new(cmd)
cron_job.minute.every(1)
Can anyone correct please my example or how can I call this File.py correctly
Upvotes: 0
Views: 568
Reputation: 293
python-crontab only works on Linux/Unix machines because windows doesn't have a crontab service component. It is possible to edit crontab files on windows, but it doesn't provide any scheduling services itself.
You should look for a python scheduler service which will continue to run in the background.
Upvotes: 2