I'm trying to start a thread (without understanding what threads are) that will call a function from a different python file every second, and set a label's text attribute to the str that it returns. The result would a be a label that every second is updated to show the current time. I could use a while True
loop but that would stop the succesive code from running, including Tkinter's Tk.mainloop()
. I've seen a lot of questions about this topic on SO but haven't gotten any solution to work so far.
What python method can start a process that continually calls an external function? And should this be before or after the mainloop()
? What exactly is that mainloop()
loop doing? The python program continues yet somehow Tkinter is still able to check for events?
Running Python 3.4