Skip to content

Instantly share code, notes, and snippets.

@dario61081
Created July 3, 2022 03:05
Show Gist options
  • Save dario61081/043b9837310297ba16c373dcef43f038 to your computer and use it in GitHub Desktop.
Save dario61081/043b9837310297ba16c373dcef43f038 to your computer and use it in GitHub Desktop.
run a Schedule task
# programming a scheduled task
import time
import schedule
def main():
pass
if __name__ == '__main__':
task_timeout_min_minutes = 15
task_timeout_max_minutes = 25
schedule.every(task_timeout_min_minutes).to(task_timeout_max_minutes).minutes.do(main)
while True:
schedule.run_pending()
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment