Next / Previous / Contents / TCC Help System / NM Tech homepage

27.2. Functions exported by pdb

The pdb module exports these functions:

pdb.run(stmt[,globals[,locals]])

Executes any Python statement. You must provide the statement as a string. The debugger prompts you before beginning execution. You can provide your own global name space by providing a globals argument; this must be a dictionary mapping global names to values. Similarly, you can provide a local namespace by passing a dictionary locals.

pdb.runeval(expr[,globals[,locals]])

This is similar to the pdb run command, but it evaluates an expression, rather than a statement. The expr is any Python expression in string form.

pdb.runcall(func[,arg]...)

Calls a function under pdb control. The func must be either a function or a method. Arguments after the first argument are passed to your function.