Python pdb and Breakpoint Cheat Sheet/Debug a single function call

Run a callable under debugger control.

Section: Advanced Usage

Debug a single function call

python
python
import pdb
pdb.runcall(func, arg1, arg2)

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Advanced Usage
Run a statement under pdb
Debug an arbitrary statement string.
OpenIn sheetpythonsame section
Run with custom globals and locals
Control execution namespaces when debugging code strings.
OpenIn sheetpythonsame section
Create a pdb alias
Define a custom shortcut command.
OpenIn sheettextsame section
Start pdb from CLI
Debug a script from the command line.
OpenIn sheetbash1 tag match
Post-mortem debugging
Inspect the traceback after an exception.
OpenIn sheetpython1 tag match
Break on function entry
Stop when a function is entered.
OpenIn sheettext1 tag match