Skip to content

Instantly share code, notes, and snippets.

@clly
Created October 22, 2012 20:41
Show Gist options
  • Select an option

  • Save clly/3934047 to your computer and use it in GitHub Desktop.

Select an option

Save clly/3934047 to your computer and use it in GitHub Desktop.
simple Thread example
import threading
theVar = 1
class MyThread(threading.Thread):
def run(self):
global theVar
print 'This is thread ' + str(theVar) + ' speaking'
print 'Hello and goodbye'
theVar = theVar + 1
for x in xrange(20):
MyThread().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment