在官方网站it is said:
When a notebook is opened, its “computational engine” (called the kernel) is automatically started. Closing the notebook browser tab, will not shut down the kernel, instead the kernel will keep running until is explicitly shut down."
是否可以配置iPython服务器,以便内核与相关选项卡一起被杀死?在
我认为
IPython.notebook.session.delete()
比IPython.notebook.kernel.kill()
好。在原因
因为
kernel.kill()
只会杀死内核。它不会告诉笔记本的sessionmanager要杀死它。 因此,在终止后,当您重新打开由kernel.kill()
(关闭的选项卡或窗口)关闭的同一ipynb文件时,sessionmanager将引发KernelError
。在关于卸载
在GoogleChrome上,卸载事件不会在移动页面上触发。 所以,我认为您还应该钩住
beforeunload
事件但是用
addEventListener('beforeunload', ...)
钩住没有用。 所以我试了window.onbeforeunload =
,效果很好。在你可以用jupyter编写一个扩展 (more about jupyter notebook extensions)。 我在IPython的早期版本中找不到任何关于笔记本扩展的信息。但是,笔记本扩展是可定制的,比
custom.js
漂亮得多小心
unload
。我的chrome 43.0.2357.130在重定向时不运行unload
。在我想为尼古拉的回答写评论,但我没有足够的观点。。。在
经过一番研究和多次尝试,这个解决方案非常简单。在文件末尾添加
profile/static/custom/custom.js
以下代码:完全适合我!(试用Chrome)
相关问题 更多 >
编程相关推荐