Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created October 31, 2013 18:28
Show Gist options
  • Save studiawan/7254546 to your computer and use it in GitHub Desktop.
Save studiawan/7254546 to your computer and use it in GitHub Desktop.
Thread example in Python 01
# http://www.ibm.com/developerworks/aix/library/au-threadingpython/
import threading
import datetime
class ThreadClass(threading.Thread):
def run(self):
now = datetime.datetime.now()
print "%s says Hello World at time: %s\n" % (self.getName(), now)
for i in range(5):
t = ThreadClass()
t.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment