Answer the question
In order to leave comments, you need to log in
How to make it run?
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"
TypeError: func must be a callable or a textual reference to one
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question