我可以在不离开ipython的情况下停止在ipython中执行当前模块 [英] Can I stop execution of current module in ipython without leaving ipython
问题描述
我想打破当前正在运行的程序并退回到shell(无需重新启动ipython)
I'd like to break out of the currently running program and be dropped back to the shell (without having to restart ipython)
推荐答案
在Windows上重新安装console2和ipython后,我遇到了同样的问题。如果您使用ipython.exe启动程序,这似乎是一个问题,它只是关闭整个窗口。但是,如果您改为使用
I had the same issue after reinstalling console2 and ipython on Windows. If you use the ipython.exe launcher, this seems to be a problem and it just closes the whole window. However, if you instead launch ipython with
python C:\ python27 \ scripts'\\ipython-script.py
然后它捕获并处理KeyboardInterrupt就好了,让我处于ipython提示符下。万岁。
then it catches and handles the KeyboardInterrupt just fine and leaves me at the ipython prompt. Hooray.
这篇关于我可以在不离开ipython的情况下停止在ipython中执行当前模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!