这里是我行动的IPython:是否可以在IPython中通过调试来运行命令?
> import my_module
> import ipdb
现在,我的模块没有任何可执行代码,它只是声明类。所以我想发表一个声明:
> g = my_module.Graph()
> f = open('test.osm')
> g.from_osm(f)
我想在Graph.from_osm里放一个断点,不用编辑文件。我不想把后面的行放到文件中,并且要做python -m ipdb ...
。我只想运行命令和调试。
这可能吗?
补充说:我看,有可能
%run -d script_name
或
> import pdb
> pdb.run('statement')
但它不可能做ipdb.run('statement')
,有一个在ipdb
没有.run
!
在ipdb 0.8中有一个'.run'。 – gerrit 2014-04-04 13:00:47
[步入IPython中的函数]的可能的重复(http://stackoverflow.com/questions/12646670/stepping-into-a-function-in-ipython) – LondonRob 2015-03-05 17:20:09