在隐身窗口中运行Jupyter Notebook [英] Run jupyter notebook in incognito window

查看:92
本文介绍了在隐身窗口中运行Jupyter Notebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行命令 jupyter笔记本 时,笔记本将在Mozilla Firefox上打开.

On executing the command jupyter notebook, notebook opens on Mozilla Firefox.

如何在命令行中以 Mozilla Firefox的隐身模式打开笔记本?

How to open notebook on incognito mode of Mozilla Firefox from command line?

推荐答案

在您的配置中,添加以下内容,将默认浏览器设置为私有firefox(改编自):

In your config add the following to set the default browser to a private firefox (adapted from here and parameters from there):

[...]
## Specify what command to use to invoke a web browser when opening the notebook.
#  If not specified, the default browser will be determined by the `webbrowser`
#  standard library module, which allows setting of the BROWSER environment
#  variable to override it.
import webbrowser
webbrowser.register('private_firefox', None, webbrowser.get('"' + 'path/to/firefox' +'" -private %s'))
c.NotebookApp.browser = 'private_firefox'
[...]

其中path/to/firefox类似于其中之一

  • /usr/bin/firefox for Linux(请参见此处)
  • /Applications/Firefox.app/Contents/MacOS/firefox for macOS(请参见)
  • C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe用于Windows(如此处所述)
  • /usr/bin/firefox for Linux (see here)
  • /Applications/Firefox.app/Contents/MacOS/firefox for macOS (see this)
  • C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe for Windows (as described here)

注释:
其他浏览器,例如Chrome(中的"...\\chrome.exe" --incognito)我想类似地工作.我还没有测试其他人.如果有任何障碍,请随时发表评论.

note:
Other browsers like Chrome ("...\\chrome.exe" --incognitoas in the source) would work analogously, I suppose. I have not tested others. Feel free to comment, if there are any hurdles.

这篇关于在隐身窗口中运行Jupyter Notebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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