Set breakpoints in Python code
Set breakpoints in your code to control execution.
Before you begin, launch your Python program. See Launch single-process Python programs or Launch parallel Python programs.
On this page:
Find the code you want to debug
If your script calls a function defined in another file or module, use one of the following methods to navigate to that code before setting breakpoints:
-
In the Source view:
-
Right-click a function name.
-
Select Navigate to File or Function.
-
-
From the menu:
-
Select Edit > Lookup File or Function.
-
Enter a full or partial file or function name.
-
Select a result to open it in the Source view.
-
For more information, see Find files and functions using the Lookup File or Function view.
Set a breakpoint
Set a breakpoint by using one of the following methods in the Source view:
-
Select a line number in the gutter.
-
Right-click a line number and select Set Breakpoint.
-
Select a line in the Source view, then select Action Points > Set Breakpoint.
After you set the breakpoint, a marker appears in the gutter and the breakpoint is added to the Action Points view.
Manage a breakpoint
Use a breakpoint's context menu to delete or disable it or to view its properties.
-
Right-click the breakpoint marker in the gutter to open its context menu.
-
(Optional) Select Delete to remove the breakpoint.
-
(Optional) Select Disable to temporarily disable the breakpoint.
-
(Optional) Select Properties to open the Modify BreakPoint dialog.
For more information about deleting or disabling action points, see Deleting, Disabling, and Suppressing Action Points. For more information about the Modify BreakPoint dialog, see Modifying a Breakpoint.