setting a breakpoint in the module

David M. Cooke cookedm+news at physics.mcmaster.ca
Wed Aug 23 18:55:00 EDT 2006


"Jason Jiang" <jiangnutao at gmail.com> writes:

> Hi,
>
> I have two modules: a.py and b.py. In a.py, I have a function called
> aFunc(). I'm calling aFunc() from b.py (of course I import module a first).
> The question is how to directly set a breakpoint in aFunc().
>
> The way I'm doing now is to set a breakpoint in b.py at the line to call
> aFunc(), 'c' to it, then 's' to step in, then set the breakpoint inside
> aFunc() by 'b lineNumber'. It's too cumbersome.

You can also add in your source

import pdb; pdb.set_trace()

at the point you want the debugger to stop. Useful if you want to
break after some failing condition, for instance.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list