Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.