1

Is there a way to cause a python script to enter the interpreter at a given line? I know I can use import pdb; pdb.set_trace() to begin debugging at a certain line, but that means all the pdb commands may get in the way.

Is there a way to kick into the regular interpreter (or ipython) outside of pdb?

jsamsf
  • 435
  • 7
  • 17

1 Answers1

0

The easiest way is code.interact:

import code
code.interact(local={**globals(), **locals()})
Brett Beatty
  • 5,690
  • 1
  • 23
  • 37