So I'm busy writing an application that needs to update a list from the web after a certain amount of time.
class Gui: def ...... def ...... def ...... def on_update_click(): update() app=Gui() Gtk.main()
So when the program loads up, user will click the update button to update the list.
I'd like the list to be updated every 6 hrs, so the update function should still run in the background
def update(): #update list time.sleep(6hrs)
I suspect I'll have to use threading.
my thinking is:
Gtk.main() runs #thread 1
when the user clicks the update button, update() runs #thread 2
when update() has gone to sleep, go back to Gtk.main() #thread 1 or start new thread 3
Is my thinking correct or have i missed something