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

Python 定时器 timer

时间:2015-09-07 15:39:56      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

#!/usr/bin/env python  
#coding=utf-8  
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()


Python 定时器 timer

标签:

原文地址:http://my.oschina.net/u/2250952/blog/502327

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