Last Updated: February 25, 2016
·
2.174K
· marshall

python breakpoint one-liner

import pdb; pdb.set_trace()

Just paste this wherever you want a breakpoint to go, and the next time that line of code is executed, you will be automatically dropped into an interactive debugger.

2 Responses
Add your response

If you're into pudb for graphical debugging:
import pudb; pudb.set_trace()

over 1 year ago ·

Good protip.

Rpdb (pdb for remote) and it's inline version is very useful too.

http://coderwall.com/p/ttbtgq

over 1 year ago ·