def run_sched(): """Loop through the schedule to check if new task""" global running # schedule.every().hour.do(job) # schedule.every().day.at("10:30").do(job) while running: schedule.run_pending() sleep(1)