Advertisement
rfmonk

threading_simple.py

Feb 3rd, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 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():
  11.     """thread worker function"""
  12.     print 'Worker'
  13.     return
  14.  
  15. threads = []
  16. for i in range(5):
  17.     t = threading.Thread(target=worker)
  18.     threads.append(t)
  19.     t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement