The Python Debugger

The Python debugger is loaded by importing the pdb module. The pdb module provides an interactive source code debugger that allows post-mortem debugging, inspection of stack frames, breakpoints, single stepping of source lines, and code evaluation.

The debugger is started by loading the pdb module and issuing one of the following functions:

					run(statement
					[,
					globals
					[,
					locals]])
				

Executes the string statement under debugger control. The debugger prompt will appear immediately before any code executes. Typing 'continue' will force it to run. globals and locals define the global and local namespaces in which the code runs.

					runeval(expression
					[,
					globals
					[,
					locals]])
				

Evaluates the expression string under debugger control. The ...

Get Python Essential Reference, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.