2013年9月22日 星期日

python-threading


from threading import Thread
class MyThread(Thread):
    def __init__(self,il):
         Thread.__init__(self);
         self.il=il;
    def run(self)
         for aa inrange(100):
              print ('hello from thread %s' self.name)
              print(self.il)
for i in range(1):
   my.thread=MyThread('a')
   my.thread.name=i;
   my.thread.start()
print('end....')



沒有留言:

張貼留言