我是ipython的新手,我正在尝试使用ipython调试我的代码。我做到了:
[1]: %pdb
Automatic pdb calling has been turned ON
然后
In [2]: %run mycode.py
在代码中,我有1/0,所以它会引发异常并自动进入调试会话。
ZeroDivisionError: float division
ipdb> variable
array([ 0.00704313, -1.34700666, -2.81474391])
所以我可以访问变量。但当我做以下事情时:
ipdb> b = variable
*** The specified object '= variable' is not a function or was not found along sys.path.
但这是有效的:
ipdb> b = self.X
目前没有回答
相关问题 更多 >
编程相关推荐