Python之jupyter notebook

cmd输入如下命令就能找到配置文件目录

[python]  view plain  copy
  1. jupyter notebook --generate-config  

让jupyter生成一个配置文件,生成后你会看到文件地址的


2.然后就可以使用记事本之类的,打开这个jupyter_notebook_config.py文件

然后查找,browser,找到如下代码:

## 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.
#c.NotebookApp.browser = u''

在这个后面,添加google浏览器

添加代码:

import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'F:\Chrome\Chrome\Application\chrome.exe'))

c.NotebookApp.browser = 'chrome'

即可。重新启动jupyter  会以chrome浏览器默认自动打开


猜你喜欢

转载自blog.csdn.net/qq_40309183/article/details/80600487