January 2019
Beginner
318 pages
8h 23m
English
The simplest and most straightforward way to run a debugger is from a command line. Our program will act as input to the debugger. You can use the debugger from command line as follows:
$ python3 -m pdb pdb_example.py
When you run the debugger from the command line, source code will be loaded and it will stop the execution on the first line it finds. Enter continue to continue the debugging. Here's the output:
student@ubuntu:~$ python3 -m pdb pdb_example.py> /home/student/pdb_example.py(1)<module>()-> class Student:(Pdb) continue01234The program finished and will be restarted> /home/student/pdb_example.py(1)<module>()-> class Student:(Pdb)
Read now
Unlock full access