Advertisement
ionutHulub

Python Threading

Mar 9th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import threading
  2. from time import sleep
  3.  
  4. def one():
  5.     while True:
  6.         print 'ello'
  7.         sleep(2)
  8.  
  9. def two():
  10.     while True:
  11.         raw_input()
  12.  
  13. t1 = threading.Thread(target=one)
  14. t2 = threading.Thread(target=two)
  15. t1.start()
  16. t2.start()
  17. t1.join()
  18. t2.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement