Setting breakpoints using Python

These steps build on the steps taken in Creating a new Python script module and Executing and debugging Python. View a completed version of this script.

Steps:
  1. Place your cursor on the following line of code in the multi_clip script:
  2. fcs = arcpy.ListFeatureClasses()
    
  3. Click the Toggle Breakpoint button Toggle Breakpoint button on the toolbar to place a breakpoint for that line.
  4. A breakpoint symbol appears on the far left margin of the script. It can be removed by clicking the Toggle Breakpoint button or clicking the Clear All Breakpoints button Clear All Breakpoints button.

  5. Click the Run button.
  6. Click the Debugging drop-down list and click Run in the debugger on the Run Script dialog box.
  7. Click OK to execute the script.
  8. The script stops where the breakpoint is set so you can step through the script from that point.

  9. Click Close to stop the script and close the Debugging window.
  10. Many breakpoints can be added to a script so you can move from one line to another during execution.

    The Go button Go button continues executing the script until the next breakpoint or the last line of code.

Related Topics

4/16/2013