Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

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.

Working With Breakpoints

Give Feedback

You can use the b command, followed by the module name and line number, to set a breakpoint:

$ b util:5

This will set a breakpoint on line 5 of the util module. If we supply no module name, then pdb will set a breakpoint in the current module we’re running.

Running b with no line number will display a list of all our current breakpoints, which we can toggle on and off or clear. The c command will continue execution up until the next breakpoint is hit. a will show us the arguments passed into a function.

We can also create conditional breakpoints, which are breakpoints that only hit when a certain condition is met. In this example, you create a breakpoint that only hits if the argument passed to get_path() does not start with a /:

$ b util.get_path, not filename.startswith('/')

When you’re setting the breakpoint with a function name rather than a line number, note that the expression should use only function arguments or global variables that are available at the time the function is entered. Otherwise, the breakpoint will stop execution in the function regardless of the expression’s value.

Amitoz on March 16, 2020

Hello, Is there any way to download the files? example[1-5].py ?

Ricky White RP Team on March 16, 2020

Hi Amitoz. I’m afraid the files are not downloadable.

Become a Member to join the conversation.