[Tkinter-discuss] Debug mainloop events

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Thu Feb 13 10:11:12 EST 2020


Hi all,

is there a way to debug the mainloop events execution.
I want to check which functions are causing some delay.
The code is too big to run with a profiler and/or add some decorators in every function.

What I would like is to have full control of the main loop, replace it with something like

while True:
     event = get_event
     if event:
            tstart = time.time()
            execute event
            print("time executing event", event, time.time() - tstart)

Vasilis


More information about the Tkinter-discuss mailing list