Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # this is from The Python
- # Standard Library by example
- # ISBN13: 9780321767349
- 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement