Interactive Debug Console

Index of All Documentation » Wing Pro Reference Manual » Debugger »

The Debug Console is an interactive Python shell for evaluating and executing Python code in the current debug stack frame, while the debug process is paused. This is a powerful tool for debugging and trying out new code interactively.

The Debug Console shares most of the features of the Python Shell, including command history, ability to evaluate code from the editor, active ranges, auto-completion, goto-definition, and integration with the Source Assistant.

Writing New Code Interactively

The Debug Console can be used to write new code in the live runtime context in which it is intended to work. To do this, set a breakpoint where you plan to place the new code, debug until you reach that breakpoint, then work in the Debug Console to design and try out the code.

Conditional breakpoints are a natural companion for the Debug Console because they can be used to isolate the particular case for which a new feature is intended.

Active Ranges

Another way to work with the Debug Console is to mark an active range of code in the editor. This is done by selecting a range of lines in the editor and pressing the Set Active Range icon at the top right of the Debug Console.

Once a range is set, additional icons appear to execute or debug the active range, jump to the active range in the editor, or clear the active range.

The active range is marked in the editor and will adjust its position and extent as code is added or deleted.

Section Contents