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

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)

主站蜘蛛池模板: 吉林市| 长宁县| 郁南县| 潮安县| 鄂伦春自治旗| 调兵山市| 汾西县| 麻阳| 新巴尔虎右旗| 柳江县| 乌兰浩特市| 全南县| 新密市| 万宁市| 犍为县| 静安区| 绥江县| 繁峙县| 思茅市| 津市市| 广饶县| 襄汾县| 静乐县| 虹口区| 武鸣县| 延安市| 阳泉市| 玉龙| 彩票| 通化市| 抚宁县| 琼海市| 邵阳县| 治多县| 新乐市| 额尔古纳市| 商河县| 海兴县| 景洪市| 隆尧县| 莎车县|