Skip to content

Instantly share code, notes, and snippets.

@pidpawel
Created December 26, 2013 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pidpawel/8133890 to your computer and use it in GitHub Desktop.
Save pidpawel/8133890 to your computer and use it in GitHub Desktop.
repeatable timer in python
def repeatable_timer(delay, func, args=[], kwargs={}):
func(*args, **kwargs)
t = Timer(delay, repeatable_timer, [delay, func, args, kwargs])
t.start()
def hello(ar):
print("Hello %s!" % ar)
repeatable_timer(1, hello, ["World"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment