How do I schedule tasks on Windows using Python?

I have the following code:

import schedule
import time

def job(t):
    print "I'm working...", t

schedule.every()"01:00").do(job,'It is sonday 01:00')

while True:
    time.sleep(60) # wait one minute

How can I make sure the code works when my PC is off or when the code is not running?

I don’t know if my question is weird but with schedule, we should be able to repeat the event. And I think it is just the case as long as the code is running.

Or easy, what happens when the code is not running and/or my pc is off?


Use the OS scheduler. In case of windows – go with