5

I'm using a interactive graphical Python debugger with ipdb under the hood (Canopy's graphical debugger). The script I am working on has multiple imported modules and several calls to their respective functions. Whenever I attempt a debugging run, execution gets stuck somewhere within a call to an imported module's function (specifically subprocess). My two main questions are:

1) Does running in debug mode slow things down considerably? Is the code not actually stuck, but just running at a painfully slow rate?

2) Is there a way to completely pass over bits of code and run them as if I were not even debugging? I want to prevent the debugger from diving into subprocess and just execute it as if it were a normal run.

I might toss the graphical debugger and do everything from a terminal, but I would like to avoid that if I can because the graphical interface is really convenient and saves a lot of typing.

4

1 回答 1

1
import pdb
a = "aaa"
pdb.set_trace()
b = "bbb"
c = "ccc"
final = a + b + c
print final

运行代码时的输出,然后它将开始调试,之后控制将停止a="aaa"

$ python abc.py
(Pdb) p a
'aaa'
(Pdb)

谢谢,沙希

于 2015-03-12T10:19:15.663 回答