在
Tracer()仍然存在IPython中在不同的模块。您可以执行以下操作:
from IPython.core.debugger import Tracerdef my_function(): x = 5 Tracer()() print 5
注意周围的其他通话括号
Tracer
编辑 :
Tracer
不建议使用IPython
6及更高版本,因此应
set_trace()改用:
from IPython.core.debugger import set_tracedef my_function(): x = 5 set_trace() print 5



