官术网_书友最值得收藏!

From a command line

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) continue
0
1
2
3
4
The program finished and will be restarted
> /home/student/pdb_example.py(1)<module>()
-> class Student:
(Pdb)

主站蜘蛛池模板: 廊坊市| 西乡县| 大足县| 洪雅县| 大足县| 恭城| 贺州市| 尼木县| 朔州市| 高邑县| 沧源| 花莲县| 荔波县| 平乐县| 肥东县| 广东省| 稷山县| 西林县| 宜宾市| 沾益县| 读书| 安西县| 台湾省| 高邮市| 讷河市| 陆河县| 三原县| 张掖市| 吉水县| 宜兴市| 都昌县| 孝昌县| 龙山县| 天台县| 怀柔区| 镇雄县| 巴中市| 台山市| 山阴县| 雷波县| 仙桃市|