我想在我的 Mac 上保留 firefox 作为我的系统默认浏览器,但在 Chrome [1]中启动 IPython Notebook 。
这个答案让我找到了我的ipython_notebook_config.py
文件,但我无法运行 Chrome 的实例。在c = get_config()
and之后import webbrowser
,我尝试过:
webbrowser.register(u'chrome', None, webbrowser.Chrome())
webbrowser.register(u'chrome', webbrowser.Chrome)
webbrowser.register(u'chrome', None, webbrowser.GenericBrowser('/Applications/Browsers/Chrome.app'))
webbrowser.register(u'chrome', None, webbrowser.GenericBrowser('/Applications/Browsers/Chrome.app/Contents/MacOS/Google\ Chrome'))
全部紧随其后c.NotebookApp.browser = u'chrome'
我webbbrowser
在解释器中摆弄过,但不知道如何创建 Chrome 的实例。
[1]: PS 为什么 IPython Notebook在 Firefox 中这么慢,尤其是对于带有内联后端的 pylab?在 chrome 中,它的速度要快几个数量级(用于渲染、滚动等)。