- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 108字
- 2021-07-02 14:00:32
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)
推薦閱讀
- Vue.js設(shè)計(jì)與實(shí)現(xiàn)
- JavaScript+jQuery網(wǎng)頁(yè)特效設(shè)計(jì)任務(wù)驅(qū)動(dòng)教程(第2版)
- Vue.js前端開(kāi)發(fā)基礎(chǔ)與項(xiàng)目實(shí)戰(zhàn)
- 零基礎(chǔ)趣學(xué)C語(yǔ)言
- 小型編譯器設(shè)計(jì)實(shí)踐
- Mastering jQuery Mobile
- MySQL數(shù)據(jù)庫(kù)應(yīng)用實(shí)戰(zhàn)教程(慕課版)
- UI動(dòng)效設(shè)計(jì)從入門到精通
- Monitoring Docker
- Building UIs with Wijmo
- 例說(shuō)FPGA:可直接用于工程項(xiàng)目的第一手經(jīng)驗(yàn)
- Android應(yīng)用開(kāi)發(fā)攻略
- VMware vSphere Design Essentials
- HTML5程序設(shè)計(jì)基礎(chǔ)教程
- Learning Zimbra Server Essentials