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

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)

主站蜘蛛池模板: 阿拉善盟| 阳高县| 旌德县| 五华县| 苍南县| 乌海市| 华蓥市| 东平县| 保亭| 聊城市| 辽阳市| 隆安县| 塘沽区| 浦北县| 南溪县| 博兴县| 乐业县| 龙陵县| 绥中县| 平乡县| 南昌县| 彭山县| 静宁县| 衡水市| 台州市| 祁阳县| 武威市| 甘南县| 岚皋县| 正定县| 巴里| 越西县| 达拉特旗| 孝义市| 汉川市| 五河县| 黔西| 连云港市| 宁城县| 红原县| 盐山县|