python3 定时器Timer

2020-12-13 02:22

阅读:563

标签:pre   star   __name__   time   定时   start   read   coding   传参   

# -*- 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

标签:pre   star   __name__   time   定时   start   read   coding   传参   

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


评论


亲,登录后才可以留言!