关闭正在运行代码的IPython Notebook [英] Closed IPython Notebook that was running code
问题描述
它如何工作?我在IPython Notebook中运行了一些代码.一些迭代的工作.
How it works? I got some code running in an IPython Notebook. Some iterative work.
偶然地我用正在运行的Notebook关闭了浏览器,但是回到IPython仪表板,我看到这个特定的Notebook没有关闭,所以如果我再次打开Notebook,我会在代码前面看到[*]它正在执行.
Accidentally I closed the browser with the running Notebook, but going back to the IPython Dashboard I see that this particular Notebook hasn't Shutdown, so if I open the Notebook again I see the [*] in front of my code that it was executing.
我什至可以听到我的PC仍在运行该代码,但是它并没有返回打印语句的任何新输出.
I even can hear my PC still running the code, but it doesn't return me any new output of the print statements.
我可以等待并最终继续输出,还是我的PC仍在运行我的代码,但是将无法再访问它?
Can I wait and eventually continue with the output, or my PC will still running my code, but it won't be accessible anymore?
推荐答案
启动ipython时,它实际上是在创建在单独进程上运行的Web服务器.代码本身在Web服务器或内核上运行. Web浏览器只是可以在内核上查看和编辑代码的几个前端之一.
When you start up ipython, it is essentially creating a web server that is running on a separate process. The code itself is running on the web server, or kernel. The web browser is simply one of several front-ends that can view and edit the code on the kernel.
此设计允许ipython将代码的评估与代码的查看和编辑区分开来-例如,我可以通过Web界面(ipython notebook
),控制台(ipython console
)或qt控制台界面(ipython qtconsole
).
This design allows ipython to separate the evaluation of code from the viewing and editing of code -- for example, I could access the same kernel via the web interface (ipython notebook
), the console (ipython console
), or the qt console interface (ipython qtconsole
).
您的PC将继续运行该代码,尽管我相信一个前端所请求的输出不会在使用相同内核的任何其他前端上显示(尽管我不确定100%这样).
Your PC will continue to run the code, though I believe that the output requested by one frontend will not show on any other frontends using the same kernel (I'm not 100% certain about this though).
您可以找到更多信息 查看全文