【问题标题】:How to default open Jupyter Notebook in incognito mode (Chrome)如何在隐身模式下默认打开 Jupyter Notebook (Chrome)
【发布时间】:2021-10-26 04:49:15
【问题描述】:

无论我做什么,jupyter notebook 总是以 chrome 非隐身模式打开。 这是我的 jupyter_notebook_config.py 文件

## 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.
#  Default: ''

import webbrowser
webbrowser.register('incognito-chrome',None, webbrowser.get("C:/Program Files/Google/Chrome/Application/chrome.exe %s --incognito"))
c.ServerApp.browser = 'incognito-chrome'

请帮忙

【问题讨论】:

  • 这能回答你的问题吗? Run jupyter notebook in incognito window
  • @Sys.Overdrive 这是我打开的第一个堆栈溢出问题。我从中复制了所有代码,然后将其调整为 google chrome incognito。但是,它没有用

标签: python jupyter-notebook


【解决方案1】:

另一种打开隐身chrome窗口的方法如下:

import webbrowser as wb
jUrl = 'http://localhost:8888' #Default jupyter host
incongnito_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s --incognito'
wb.get(incongnito_path).open_new(jUrl)

这对我有用!

【讨论】:

  • 嗨,让我弄清楚,有没有办法配置文件,以便打开的浏览器是 chrome incognito?因为您给我的解决方案基本上是在另一个常规 chrome 选项卡上打开了一个 chrome 隐身选项卡(因为默认配置从未更改)
  • @sirj 是的,到目前为止,这是您能做的最好的事情。但是我会尝试在我的本地查看是否可以调整 jupyter 设置以使其在 jupyter 应用程序级别上工作,我会在这里发布。
猜你喜欢
  • 2012-08-05
  • 2016-10-12
  • 2015-05-06
  • 2014-06-11
  • 1970-01-01
  • 1970-01-01
  • 2023-02-04
  • 2023-02-18
  • 1970-01-01
相关资源
最近更新 更多