如何隐藏 Jupyter Notebook 服务器上的“退出”按钮?

Dev*_*eto 5 jupyter jupyter-notebook

我有一个其他人可以访问的 jupyter 笔记本服务器,我想隐藏“退出”按钮所有用户,以避免服务器意外关闭。

我该怎么做?

Eth*_*n T 8

您需要c.NotebookApp.quit_button在文件中使用该选项jupyter_notebook_config.py。要添加的行是:

c.NotebookApp.quit_button = False
Run Code Online (Sandbox Code Playgroud)

如果您还没有此文件,请通过运行以下命令创建一个新文件:

jupyter notebook --generate-config
Run Code Online (Sandbox Code Playgroud)

如果您使用该命令创建示例配置文件,您应该已经看到该选项的注释掉版本quit_button。取消注释并将其设置为 false。