python -m pdb hello.py
在执行命令行中 添加一句 -m pdb 即可!
开始之后,首先输入:
(Pdb) n #单步执行,next的首字母,之后一直按回车 即可单步执行
(Pdb) s #step的首字母Step Into
(Pdb) r #return的首字母Setp Return
(Pdb) c #continue的首字母 Resume
(Pdb) j 10 #运行到地10行,jump的首字母 Run to Line
(Pdb) p param #查看当前param变量值
(Pdb) l #查看运行到某处代码
(Pdb) a #查看全部栈内变量
(Pdb) h #帮助,help的首字母
(Pdb) q #退出,quit的首字母