Python debug
来源:互联网 发布:win10兼容xp软件 编辑:程序博客网 时间:2024/06/07 06:12
两种方法
1.在python解释器中使用:
$ python -m pdb my_script.py
2.在脚本中运行
在需要设置断点的地方,插入方法 pdb.set_trace()
举例:
import pdbdef make_bread(): pdb.set_trace() return "I don't have time"print(make_bread())
执行结果:
>>> print(make_bread())> <pyshell#2>(4)make_bread()(Pdb) n #执行下一句--Return--> <pyshell#2>(4)make_bread()->"I don't have time" #下一句是`return "I don't have time"`(Pdb) c #继续执行I don't have time #输出>>>
其中debug有用到一些语法:
阅读全文
0 0
- debug python
- python debug【】
- python debug
- Python Debug
- Python debug
- python debug
- 关于Python的Debug...
- python Debug 文件结束
- python debug 工具pdb
- python 语言如何debug
- pdb (python debug)
- python debug and build
- Python——debug
- Python debug(二)
- python multiprocessing debug
- pdb debug python
- 运程debug python程序
- debug python in ipython
- APUE第十一章学习笔记
- 1.1 创建虚拟机,安装CentOS 7.3(图文教程)
- Linux下如何在进程中获取虚拟地址对应的物理地址
- $.ajax()方法详解
- apk反编译,(apktool)系统应用回编译出错的解决办法
- Python debug
- 网络命令的使用
- 无人系统的未来世界
- 用python打印25种表情
- 拉格朗日乘子法(Lagrange Multiplier) 和KKT条件
- OS学习笔记八:死锁
- java.lang.CharSequence cannot be resolved
- hdu6076
- HDU 5965扫雷