SHARE
TWEET

Python Threading

ionutHulub Mar 9th, 2013 6 Never
  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()
RAW Paste Data
Top