Skip to content

Instantly share code, notes, and snippets.

@pkulev
Created Aug 20, 2014
Embed
What would you like to do?
>>> def timer(t, cb):
... time.sleep(t)
... cb()
...
>>> import time
>>> def foo():
... print("Я проснулася!")
>>> th = threading.Thread(name='th1', target=timer, args=(5, foo))
>>> th.start()
>>> Я проснулася!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment