Skip to content

Instantly share code, notes, and snippets.

@r4vi
Created December 17, 2013 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r4vi/8008148 to your computer and use it in GitHub Desktop.
Save r4vi/8008148 to your computer and use it in GitHub Desktop.
python threading
#!/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