add python threading examples and intros for lec 18 spoc discuss

This commit is contained in:
yuchen
2015-05-06 12:41:12 +08:00
parent b233b49dcb
commit 340eebff1b
10 changed files with 629 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import threading
class MyThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
print "I am %s" % (self.name)
if __name__ == "__main__":
for i in range(0, 5):
my_thread = MyThread()
my_thread.start()