-
Timer:定時調用函數
例子1:
import threading import time def hello(name): print ("hello %s\n" ) % name global timer timer = threading.Timer(2.0, hello, ["Hawk"]) timer.start() if __name__ == "__main__": timer = threading.Timer(2.0, hello, ["Hawk"]) ##每隔兩秒調用函數hello timer.start()