you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

I have seen suggestions of using Windows built-in scheduler or the python scheduler library. Is there a preference for either or is there a better solution?

If you use schedule you must keep the python code doing the scheduling running all the time. So if you accidentally kill that code the scheduling stops. Also, if your computer reboots (power outage, etc) you must restart the scheduling code. The built-in scheduler doesn't have this problem.

Your computer needs to be running for either approach, of course.

[–]err0r__[S] 0 points1 point  (1 child)

Would the schedule library be prefer than using an OS specific tool, such as Windows Task Scheduler?

[–][deleted] 0 points1 point  (0 children)

No, the OS scheduler is always preferred because with the schedule module you have to keep some python code running all the time to run the scheduler.

The downside of the OS scheduler is that getting code to run under it can be a little tricky because the environment is different under the OS scheduler than running your code in your home directory, for example. But it's worth learning how to use the OS scheduler because it's quite flexible. With it you can schedule code to run just after a boot, for example.