Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Getting Started With pdb

Give Feedback

Now that you know what pdb is, it’s time to get started! You can break into the debugger with just a single line of Python code:

import pdb; pdb.set_trace()

When execution reaches this point, the program stops and you’re dropped into the pdb debugger. If you’re using Python 3.7 or later, then you can also use breakpoint() instead. You can automatically enable or disable all of your breakpoint() calls by modifying environment variables.

pdb also supports post-mortem debugging, which will tell Python to drop you into a pdb prompt as soon as an exception is reached. This is useful for when you don’t have write access to a Python script but still want to debug it. Just run your script like this:

$ python3 -m pdb my_script.py

Become a Member to join the conversation.