我可以在不离开ipython的情况下停止在ipython中执行当前模块 [英] Can I stop execution of current module in ipython without leaving ipython

查看:214
本文介绍了我可以在不离开ipython的情况下停止在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆