创建两个线程,并运行
#-*-coding:utf-8-*-
#__author:martin
#date:2017/10/22
import threading
class Mythread(threading.Thread):
def __init__(self,num):
threading.Thread.__init__(self)
self.num = num
def run(self):
print('running thread %s ' % (self.num))
t1 = Mythread('10')
t2 = Mythread('20')
t1.start()
t2.start()