Created
October 31, 2013 18:28
-
-
Save studiawan/7254546 to your computer and use it in GitHub Desktop.
Thread example in Python 01
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
# 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