Advertisement
rfmonk

threading_simpleargs.py

Feb 3rd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # this is from The Python
  4. # Standard Library by example
  5. # ISBN13: 9780321767349
  6.  
  7. import threading
  8.  
  9.  
  10. def worker(num):
  11.     """ thread worker function"""
  12.     print 'Worker: %s' % num
  13.     return
  14.  
  15. threads = []
  16. for i in range(5):
  17.     t = threading.Thread(target=worker, args=(i,))
  18.     threads.append(t)
  19.     t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement