#!/usr/bin/python3 import sys from PyQt5.QtCore import QCoreApplication from PyQt5.QtCore import QTimer class Chick(QCoreApplication): def __init__(self, *args, **kwargs): super(Chick, self).__init__(*args, **kwargs) updateTimer = QTimer() updateTimer.timeout.connect(self.test) updateTimer.start(1) self.test() def test(self): print('test') app = Chick(sys.argv) app.exec_()