[Python] 一个简单的python定时器实现 →→→→→进入此内容的聊天室

来自 , 2020-07-06, 写在 Python, 查看 132 次.
URL http://www.code666.cn/view/b9937273
  1. import threading  
  2. def sayhello():  
  3.         print "hello world"  
  4.         global t        #Notice: use global variable!  
  5.         t = threading.Timer(5.0, sayhello)  
  6.         t.start()  
  7.  
  8. t = threading.Timer(5.0, sayhello)  
  9. t.start()  
  10.  
  11.  
  12. #//python/6420

回复 "一个简单的python定时器实现"

这儿你可以回复上面这条便签

captcha