views:

335

answers:

1

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

+7  A: 
import pdb; pdb.set_trace()

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

Daryl Spitzer
Seems like someone just wanted to ask a question to answer it himself. 7 seconds?
Alex Fort
From [the FAQ](http://stackoverflow.com/faq):> It's also perfectly fine to ask and answer your own programming question, but pretend you're on Jeopardy: phrase it in the form of a question.
Daryl Spitzer