Combining Tkinter mainloop with another event listener Combining Tkinter mainloop with another event listener tkinter tkinter

Combining Tkinter mainloop with another event listener


You don't need to create a function to use mainloop() so just simply place the mainloop() at the bottom of your code. If you want a delay on it, use root.after(milliseconds, function)

Also, remember to put mainloop() before PumpMessages()

e.g.

def mainloopfunction():    mainloop()root.after(5000, mainloopfunction)

Hope I could help!