在Jupyter中:
from IPython.core.debugger import set_trace
a = 4
b = 5
set_trace()
c = a*b
这样就会进入到断点调试中:
ipdb> p a
查看变量a的值
ipdb> l
查看前后代码
ipdb> c
继续运行后面的代码
在一般代码中:
a = 4
b = 5
__import__('pdb').set_trace()
c = a * b
在Jupyter中:
from IPython.core.debugger import set_trace
a = 4
b = 5
set_trace()
c = a*b
这样就会进入到断点调试中:
ipdb> p a
查看变量a的值
ipdb> l
查看前后代码
ipdb> c
继续运行后面的代码
在一般代码中:
a = 4
b = 5
__import__('pdb').set_trace()
c = a * b
本文标题:python的断点调试
本文链接:https://www.haomeiwen.com/subject/oglinctx.html
网友评论