Created
October 31, 2013 18:30
-
-
Save studiawan/7254585 to your computer and use it in GitHub Desktop.
Thread example in Python 03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://pymotw.com/2/threading/index.html | |
import threading | |
def worker(num): | |
print 'Worker: %s' % num | |
threads = [] | |
for i in range(5): | |
t = threading.Thread(target=worker, args=(i,)) | |
threads.append(t) | |
t.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment