Thonny IDE Debugger Guide | CMSC 105 Elementary Programming - Fall 2024

Thonny IDE Debugger Guide

Thonny is an integrated development environment (IDE) designed for beginners to learn Python. One of its most powerful features is the built-in debugger, which allows you to step through your code and inspect variables to better understand how your program runs. Here’s a guide to using the debugger in Thonny.

Opening the Debugger

To start using the debugger, follow these steps:

Debug 1

Setting Breakpoints

Breakpoints tell the debugger where to pause the program, allowing you to inspect the state of the program at that point.

Thonny will pause execution when it reaches the line with the breakpoint.

Debug 2

Running in Debug Mode

After setting breakpoints, follow these steps to run your program in debug mode:

Debug 3

Stepping Through Code

Once the program is paused, you can control the flow of execution using the following controls:

Debug 4

Debug 5

Debug 6

Debug 7

Inspecting Variables

While debugging, Thonny provides a Variables window where you can see the current values of variables.

Debug 8

Call Stack

Thonny also shows the Call Stack, which is located in the lower-right corner of the debugger window.

Debugging Tips


Thonny’s debugger is easy to use, yet powerful enough to help you understand your code’s flow, making it an excellent tool for Python learners.