Control execution namespaces when debugging code strings.
Section: Advanced Usage
Run with custom globals and locals
python
python
import pdb
pdb.runctx("result = fn(x)", globals(), locals())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