After selecting a script in the Python Script Editor, you can use toolbar buttons to run the debugger.
Contents [Hide] |
Use any of these methods to begin debugging:
In the GainSeeker Inspections module, use Manage Inspections to edit the Inspection. Double-click any Formula test with a Python script selected.
In the GainSeeker Inspections module, use Manage Inspections to edit the Inspection. Right-click on the Inspection Editor window and then click Debug (PC).
In the GainSeeker Inspections module, open the list of Inspections or the list of Planned Inspections. Select the Inspection or Planned Inspection you wish to debug, select the Debug check box, and then click the Run button.
The Python Script Editor will be displayed before the inspection is launched.
Click any code-only scripts that may be executed by the inspection and insert breakpoints where desired.
(For Action-based scripts in an inspection, you can insert breakpoints later while the inspection is running.)
From any script in the Python Script Editor, click the Start button (or press F5) or the Step button (or press F8).
The debugger will launch the Inspection, and Python scripts will be triggered by Formula tests in the Inspection.
The debugger will automatically pause and display the current script in the Python Script Editor when any of these occur:
the debugger encounters a breakpoint in the currently-running script
you use the Step button (or press F8) to step through code
the inspection triggers an Action-based script
In any of these cases when the debugger is paused and the Python Script Editor is displayed, you can use the buttons and tools described below.
After the current script has finished running, the Python Script Editor window will automatically close and you can continue running the Inspection.
You can insert breakpoints to pause the debugger before it executes certain lines of code.
You can add and remove breakpoints before you launch the debugger and any time the debugger is paused.
To insert a breakpoint, click in the area to the left of the line number. Pressing F9 will also insert a breakpoint on the current line. You cannot insert a breakpoint on an empty line.
To clear a breakpoint, click the breakpoint symbol. Pressing F9 will also clear a breakpoint from the current line.
There are two ways to run the debugger:
To execute all of the script from
the beginning until the first breakpoint
is found (if any) or until the end of the script is reached, click
the Start button
or press the F5 key.
When the debugger is running but paused, this button changes to
. If triggered, the debugger will continue
running from its current position in the code until the next breakpoint
is found (if any) or until the end of the script is reached.
To step through the code one line at a time, click the Step button or press the F8 key. (When stepping through a line that executes the Python import command, you may need to click or press F8 several times to move to the next line of code.)
Note:
When you first launch the debugger for a script, it begins code execution
from the top of the script.
When the debugger is paused - either because of a breakpoint or because you are stepping through the code line by line - the debugger stops before the highlighted line of code is executed. At this point you can click the Start button to continue running the script, click the Step button to execute the highlighted line of code, or execute additional Python commands.
While the debugger is running, new panels display a console window and Local Variables.
Values that you print to console are displayed in the upper panel. You can edit or delete text in this panel. To jump to the start or the end of the panel's contents, click the panel and then press Ctrl+Home or Ctrl+End.
Values of Python variables, lists, and dictionaries are displayed in the lower panel.
While the debugger is running, you cannot change the code in the script.
However, you can enter ad-hoc Python commands for the debugger to execute. To do so, type a command in the box at the bottom of the debugger and then click Execute. You can also click the arrow button to select a previously-entered command.
To pause a running script, click the Pause button . At this point you can click the Start button to continue running the script, click the Step button to execute the highlighted line of code, or execute additional Python commands.
To stop debugging the script, click the Stop button or press the Esc key. The Inspection window will close and the Python Script Editor window will stay open for editing.