- 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)
推薦閱讀
- 黑客攻防從入門到精通(實戰秘笈版)
- .NET 4.0面向對象編程漫談:基礎篇
- Python網絡爬蟲從入門到實踐(第2版)
- Nexus規模化Scrum框架
- JAVA程序設計實驗教程
- Hands-On Reinforcement Learning with Python
- Statistical Application Development with R and Python(Second Edition)
- Angular應用程序開發指南
- C語言程序設計與應用實驗指導書(第2版)
- SCRATCH編程課:我的游戲我做主
- AI輔助編程Python實戰:基于GitHub Copilot和ChatGPT
- PHP典型模塊與項目實戰大全
- 像程序員一樣使用MySQL
- Salt Cookbook
- Vue.js從入門到精通