January 2019
Beginner
318 pages
8h 23m
English
The pdb module is used to debug Python programs. Python programs use pdb interactive source code debugger to debug the programs. pdb sets breakpoints and inspects the stack frames, and lists the source code.
Now we will learn about how we can use the pdb debugger. There are three ways to use this debugger:
We are going to create a pdb_example.py script and add the following content in that script:
class Student: def __init__(self, std): self.count = std def print_std(self): for i in range(self.count): print(i) returnif __name__ == '__main__': Student(5).print_std()
Using this script as an example to learn Python debugging, we will see how we can start the ...
Read now
Unlock full access