Python 在Terminal上Debug指令-------------pdb

Python不用IDE怎么自己debug呢!

java 有 jdb
c++ 有 gdb
python 就是 pdb啊

指令:

python3 -m pdb test.py

进入debug模式后,下面是一些在pdb常用的debug指令:

  1. (break)在test.py文件的30行设置breakpoint(断点)
b test.py:30
  1. (continue)让程序一直运行到设置的断点
c
  1. (next)运行到下一行代码
n
  1. (step)进入下一行代码用到的function或class
s

祝你好运~

猜你喜欢

转载自blog.csdn.net/weixin_43873005/article/details/89475602