IPython 交互式debug
增强pdb ,语法高亮,tab 自动补全
【debug时机是刚出现异常那会】
%debug
u #跟踪栈在各级间的切换
d
设置断点单步调度
%run -d script.py
s 进入脚本 ,
b 13 # 在13行设置断点
c # continue till touch the break point
n # 执行下一行。
如果有exception 报出:throws_an_exception ,
ipdb> s # 单步进入 exception 那行.
ipdb> !a #在变量a 前加 ! 查看 变量内容
debug function
import pdb
pdb.run('datasets.load_iris()')
#import ipdb
set_trace特别函数