1. def count(i):  
  2.      for k in range(1, 100+1):  
  3.         text.insert(END,'第'+str(i)+'线程count:  '+str(k)+'\n')  
  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')  

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-29
  • 2021-11-14
  • 2021-07-15
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案