def buttonGo(self):
self.statusBar().showMessage('In progress...')
scheduler = BackgroundScheduler()
scheduler.add_job(tick(self), 'interval', seconds=3)
scheduler.start()
try:
# This is here to simulate application activity (which keeps the main thread alive).
while True:
time.sleep(2)
except (KeyboardInterrupt, SystemExit):
scheduler.shutdown() # Not strictly necessary if daemonic mode is enabled but should be done if possible
def tick(self):
print "test"
Выводит только 1 раз и выдает ошибку -
TypeError: func must be a callable or a textual reference to one