How to do it...

While this recipe applies to the PyDev plugin in the Java-based Eclipse IDE, its principles also apply to many modern IDEs.

The first position where we might wish to place a breakpoint is at the place where we make our GUI visible by calling the tkinter main event loop.

The green balloon symbol on the left is a breakpoint in PyDev/Eclipse. When we execute our code in debug mode, the execution of the code will be halted once the execution reaches the breakpoint. At this point, we can see the values of all the variables that are currently in scope. We can also type expressions into one of the debugger windows, which will execute them, showing us the results. If the result is what we want, we might decide to change our code using ...

Get Python GUI Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.