首页 > 编程语言 > 详细

python3 定时器Timer

时间:2019-06-16 20:34:36      阅读:96      评论:0      收藏:0      [点我收藏+]
# -*- coding: utf-8 -*-
from threading import Timer


def talk(name):
    print("%s is talking." % name)


if __name__ == __main__:
    ‘‘‘Timer(等待多少秒, 执行的函数, args给函数传参数)‘‘‘
    timer = Timer(3, talk, args=("lily",))
    timer.start()

# lily is talking.

 

python3 定时器Timer

原文:https://www.cnblogs.com/lilyxiaoyy/p/11032639.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!