我使用的是 win10,我的默认浏览器是 chrome。
当我运行以下命令 python -m notebook
google 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: ''
c.NotebookApp.browser = 'C:/Program Files/Google/Chrome/Application/chrome.exe -incognito %s'
答案 0 :(得分:1)
您只需将其复制到 .py
文件即可。
import webbrowser
webbrowser.register('private_chrome', None, webbrowser.get('"' + 'C:/Program Files/Google/Chrome/Application/chrome.exe' +'" -incognito %s'))
c.NotebookApp.browser = 'private_chrome'