码迷,mamicode.com
首页 > 编程语言 > 详细

python 实现定时循环触发某个方法

时间:2015-09-02 23:20:57      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:

直接贴上代码

import threading 
def sayhello(): 
        print "hello world" 
        global t        #Notice: use global variable! 
        t = threading.Timer(5.0, sayhello) 
        t.start() 
   
t = threading.Timer(5.0, sayhello) 
t.start() 

线程t不断的改变

python 实现定时循环触发某个方法

标签:

原文地址:http://www.cnblogs.com/reddusty/p/4779566.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!