Debug an arbitrary statement string.
Section: Advanced Usage
Run a statement under pdb
python
python
import pdb
pdb.run("main()")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 with custom globals and locals
Control execution namespaces when debugging code strings.
Route breakpoint() to pdb.set_trace
Set an explicit hook from the environment.