美文网首页Python应用集
Python调试工具`pdb` —— Python Debuge

Python调试工具`pdb` —— Python Debuge

作者: Solomon_Xie | 来源:发表于2019-01-11 00:47 被阅读0次

参考文章1参考文章2

  • 启动方法一:python -m pdb PATH-TO-SCRIPT.py
  • 启动方法二:代码中写入import pdb;pdb.set_trace(),即插入了一个断点。

常用命令

# 退出循环 (指针要指在for语句上才行)
until

# 下一步
next 或 n

# 深入性下一步(进入每次调用的函数里面)
step 或 s

# 移动到上一层/下一层函数
up 或 u
down 或 d

# 执行直至当前函数结束
return 或 r

相关文章

网友评论

    本文标题:Python调试工具`pdb` —— Python Debuge

    本文链接:https://www.haomeiwen.com/subject/wmxirqtx.html