1
我嘗試使用調試器IPython的3.1我的Python 2.7.9安裝在Windows 7調試器IPython中不工作
下面是一個示例腳本:
def works_fine():
a = 5
b = 6
assert(a + b == 11)
def throws_an_exception():
a = 5
b = 6
assert(a + b == 10)
def calling_things():
works_fine()
throws_an_exception()
calling_things()
我踏進代碼爲%debug
。
我去了u
然後,我在第12行添加一個斷點與b 12
我按c
然後,而不是調試運行繼續它打印出「IPDB> C」,而不是繼續..我應該如何解決這個問題?
> <ipython-input-7-c95b844c9880>(9)throws_an_exception()
8 b = 6
----> 9 assert(a + b == 10)
10
ipdb> u
> <ipython-input-7-c95b844c9880>(13)calling_things() 2 12 works_fine()
---> 13 throws_an_exception()
14
ipdb> b 12 Breakpoint 3 at <ipython-input-7-c95b844c9880>:12
ipdb> c
如何將代碼加載到ipython中? – skyline75489
予加載它是這樣的:在筆記本電腦內的第一行:'DEF works_fine(): 1 = 5 B = 6 斷言(A + B == 11) DEF throws_an_exception(): 1 = 5 b = 6 斷言(A + b == 10) DEF calling_things(): works_fine() throws_an_exception() calling_things()' –