Skip to content

Instantly share code, notes, and snippets.

@x
Created April 22, 2015 05:02
Show Gist options
  • Save x/e70d745a6a9d1d1bf8e0 to your computer and use it in GitHub Desktop.
Save x/e70d745a6a9d1d1bf8e0 to your computer and use it in GitHub Desktop.
looping scheduled function python
import time, sched
scheduler = sched.scheduler(time.time, time.sleep)
def do_stuff():
scheduler.enter(3, 1, do_stuff, ())
print "hi"
scheduler.enter(3, 1, do_stuff, ())
scheduler.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment