Python定时执行之Timer

admin 2016年9月1日16:31:45Python评论1,924 次浏览阅读模式
  1. #!/usr/bin/env python  
      
      
    from threading import Timer  
    import time  
      
    timer_interval=1  
    def delayrun():  
        print 'running'  
      
    t=Timer(timer_interval,delayrun)  
    t.start()  
    while True:  
        time.sleep(0.1)  
        print 'main running'

source:http://blog.csdn.net/imzoer/article/details/8699083

相关文章
weinxin
我的微信
微信扫一扫
admin
  • 本文由 发表于 2016年9月1日16:31:45
  • 转载请务必保留本文链接:https://anyun.org/a/jishuguanzhu/bianchengchalou/python/2016/0901/6210.html

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: