python中定时器的用法

关于定时器这块一直是迷迷瞪瞪的,到现在也没有彻底理解,在网上找到一些大神写的代码,记录在这里,以备不时之需!!
**Qt中定时器的使用有两种方法,一种是使用QObject类提供的定时器startTimer,一种是使用QTimer类
python中定时器的用法
python中定时器的用法
我的理解是定时器主要是以下这几行:
self.syf = QtCore.QTimer()
self.syf.start(30)
self.syf.timeout.connect(self.AlertPicShow)
其中: self.syf.timeout.connect(self.AlertPicShow)中的self.AlertPicShow是定时器用来绑定函数AlertPicShow。

如上!!!