How do you break into the debugger from Python source code?

Daryl Spitzer picture Daryl Spitzer · Sep 29, 2008 · Viewed 9.6k times · Source

What do you insert into Python source code to have it break into pdb (when execution gets to that spot)?

Answer

Daryl Spitzer picture Daryl Spitzer · Sep 29, 2008
import pdb; pdb.set_trace()

See Python: Coding in the Debugger for Beginners for this and more helpful hints.