python第三方库ipdb(debug模块)

文章目录

安装

  • ipdb是用来python中用以交互式debug的模块,可以直接利用pip安装
pip install ipdb

使用

  • 当程序运行到ipdb.set_trace()的地方会自动进入debug模式。
for i in range(5):
    print(i)
    ipdb.set_trace()

常用命令

  • n \to next
  • ENTER \to 重复上次命令
  • q \to 退出
  • p<变量> \to 打印变量
  • c \to 继续
  • l \to 查找当前位于哪里
  • s \to 进入子程序
  • r \to 运行直到子程序结束
发布了32 篇原创文章 · 获赞 18 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/Jimmyzqb/article/details/85138162