- 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)
推薦閱讀
- C語(yǔ)言程序設(shè)計(jì)(第3版)
- Visual Basic程序開發(fā)(學(xué)習(xí)筆記)
- vSphere High Performance Cookbook
- Java EE 7 Development with NetBeans 8
- Python算法從菜鳥到達(dá)人
- Windows Phone 7.5:Building Location-aware Applications
- Extreme C
- 案例式C語(yǔ)言程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)
- Spring技術(shù)內(nèi)幕:深入解析Spring架構(gòu)與設(shè)計(jì)原理(第2版)
- Xcode 6 Essentials
- Mastering Elixir
- Oracle實(shí)用教程
- Mastering Gephi Network Visualization
- Learning Unreal Engine Game Development
- C#程序設(shè)計(jì)基礎(chǔ)入門教程