#!/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()
时间: 2024-10-07 14:02:43
#!/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()