Here are my actions in IPython:
> import my_module
> import ipdb
Now, my module lacks any executable code, it only declares classes. So I want to make a statement:
> g = my_module.Graph()
> f = open('test.osm')
> g.from_osm(f)
I want to put a breakpoint inside Graph.from_osm, without editing the file. I don't want to put the latter lines into the file and to do python -m ipdb ...
. I just want to run commands and debug.
Is this possible?
added: I see, it's possible to
%run -d script_name
or
> import pdb
> pdb.run('statement')
but it's impossible to do ipdb.run('statement')
, there's no .run
in ipdb
!