1.python -m pdb xxxx.py
其中 -m 参数 == module-name
Searches sys.path for the named module and runs the corresponding .py file as a script.
以pdb 就模块 运行xxxx.py
常用命令
常用pdb命令
2.交互调试 pdb.run("func()")
import pdb
测试test函数 既
pdb.run("test(100,100)");
其中需要函数调用字符串,而不添加双引号则为直接调用函数,
调用run函数后,进入pdb模式 继而s 进入函数内部进行调试
3.埋点调试
import pdb
在需要添加断点的地方添加 pdb.set_trace()