Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save giridharmb/704bdf281fd9138736cbad96c7c234dd to your computer and use it in GitHub Desktop.

Select an option

Save giridharmb/704bdf281fd9138736cbad96c7c234dd to your computer and use it in GitHub Desktop.
scheduling using threads
import time
import threading
def task():
print("Job Completed!")
def schedule():
while 1:
task()
time.sleep(10)
# makes our logic non blocking
thread = threading.Thread(target=schedule)
thread.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment