让 Jupyter notebook 自动打开浏览器

让 Jupyter notebook 自动打开浏览器

首先打开 Anaconda Prompt,然后输入:

jupyter notebook --generate-config

然后通过 Everything 软件查找文件 jupyter_notebook_config.py 并将其打开。

定位以下代码:

## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''

在以上代码下面加入如下代码:

import webbrowser
webbrowser.register('chrome',None,webbrowser.GenericBrowser(u'D:/Googlechrome/Google/Chrome/Application/chrome.exe'))
c.NotebookApp.browser = 'chrome'

注意其中的 'D:/Googlechrome/Google/Chrome/Application/chrome.exe' 路径是你电脑 chrome.exe 所在的位置,如果想换其他浏览器同理。

保存后,此时在 cmd 中输入 jupyter notebook 就可以让其自动打开浏览器。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值