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.
Written by Marshall Culpepper
Related protips
2 Responses
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.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Related Tags
#python
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#