Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from threading import Thread
- class worker(Thread):
- def run(self):
- for x in xrange(0,11):
- print x
- time.sleep(1)
- class waiter(Thread):
- def run(self):
- for x in xrange(100,103):
- print x
- time.sleep(5)
- def run():
- worker().start()
- waiter().start()
- >>> thread_test.run()
- 0
- 100
- >>> 1
- 2
- 3
- 4
- 5
- 101
- 6
- 7
- 8
- 9
- 10
- 102
Add Comment
Please, Sign In to add comment