python 命令行断点调试pdb的应用

2017-09-26  本文已影响0人  金克拉拉拉拉

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()

上一篇 下一篇

猜你喜欢

热点阅读