# thread_example.py import time import threading print "thread_example.py running" class MyThread(threading.Thread): def __init__ (self,myid): self.myid=myid threading.Thread.__init__(self) print "MyThread number ", print self.myid, print " inited" def run(self): print "MyThread number ", print self.myid, print " running" MyThread(1).start() MyThread(2).start() MyThread(3).start() MyThread(4).start() # time.sleep(1.0) print "thread_example.py ending" print "dir(threading)" print dir(threading)