January 2019
Beginner
318 pages
8h 23m
English
To start the debugger from the Python interactive console, we are using run() or runeval().
Start your python3 interactive console. Run the following command to start the console:
$ python3
Import our pdb_example script name and the pdb module. Now, we are going to use run() and we are passing a string expression as an argument to run() that will be evaluated by the Python interpreter itself:
student@ubuntu:~$ python3Python 3.5.2 (default, Nov 23 2017, 16:37:01)[GCC 5.4.0 20160609] on linuxType "help", "copyright", "credits" or "license" for more information.>>>>>> import pdb_example>>> import pdb>>> pdb.run('pdb_example.Student(5).print_std()')> <string>(1)<module>()(Pdb)
To continue debugging, enter continue after ...
Read now
Unlock full access