Advertisement
rfmonk

threading_subclass.py

Feb 4th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 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. import logging
  9.  
  10. logging.basicConfig(level=logging.DEBUG,
  11.                     format='(%(threadName)-10s) %(message)s',
  12.                     )
  13.  
  14.  
  15. class MyThread(threading.Thread):
  16.  
  17.     def run(self):
  18.         logging.debug('running')
  19.         return
  20.  
  21. for i in range(5):
  22.     t = MyThread()
  23.     t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement