how does jupyter notebook handle calls to quit()?

我们两清 提交于 2019-12-07 17:55:35

问题


I have discovered a very odd behavior of Jupyter Notebook:

In [1]:

print("hello")
quit()
print("world")

Out [1]:

hello
world

The kernel does actually die afterward (I get a popup, "The kernel appears to have died. It will restart automatically."), but not before printing both.

Why does it work this way? Perhaps this has something to do with Jupyter's architecture that I don't know about.

Incidentally there is not actually an "Out[1]:" prefix, it just shows the output. That's probably an unrelated point though.

来源:https://stackoverflow.com/questions/44076562/how-does-jupyter-notebook-handle-calls-to-quit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!