多线程小模块

  1. def count(i):  
  2.      for k in range(1, 100+1):  
  3.         text.insert(END,'第'+str(i)+'线程count:  '+str(k)+' ')  
  4.         time.sleep(0.001)  
  5.             
  6.   
  7. def fun():  
  8.     for i in range(1, 5+1):  
  9.         th=threading.Thread(target=count,args=(i,))  
  10.         th.setDaemon(True)#守护线程  
  11.         th.start()  
  12.     var.set('MDZZ')  
原文地址:https://www.cnblogs.com/monsteryang/p/6592382.html