我在Windows7中使用Python2.7。
我用过定时器
但计时器只能运行一次
import threading
class BesDldMainWnd(QMainWindow):
def fun_timer(self):
print 1
def StartAll(self):
timer = threading.Timer(30, self.fun_timer)
timer.start()
m = BesDldMainWnd()
m.Startall()
time.sleep(30)
m.Startall()
我以为计时器会运行两次,但它只运行一次
我试过这个密码
结果如下
所以它的工作原理和预期一样
相关问题 更多 >
编程相关推荐