Skip to content

Instantly share code, notes, and snippets.

@shrunyan
Last active December 25, 2015 00:29
Show Gist options
  • Save shrunyan/6888181 to your computer and use it in GitHub Desktop.
Save shrunyan/6888181 to your computer and use it in GitHub Desktop.
Threading example in python
import threading
def worker(num):
"""thread worker function"""
print 'Worker: %s' % num
return
threads = []
for i in range(5):
t = threading.Thread(target=worker, args=(i,))
threads.append(t)
t.start()
print threads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment