Created
December 17, 2013 16:48
-
-
Save r4vi/8008148 to your computer and use it in GitHub Desktop.
python threading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import threading | |
import time | |
class Sleepy(threading.Thread): | |
def run(self): | |
time.sleep(5) | |
print 'hello from bg thread' | |
s = Sleepy() | |
s.start() | |
# print 'The main program continues to run in foreground.' | |
s.join() | |
print 'Main program waited until background was done.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment