Launch IPython notebook with selected browser

前端 未结 9 1610
暖寄归人
暖寄归人 2020-12-02 05:57

I am trying to start IPython with a non default browser (in my case Firefox) and thought I could replicate the replicate the script given in this blog

I am o

9条回答
  •  我在风中等你
    2020-12-02 06:34

    This is not a real answer. I just want to share with the less computer savvy what JPG's answer looks like step-by-step. Presumably, on Windows Explorer (screen capture attached below), the file jupyter_notebook_config.py is listed:

    In my case, the directory for the file (on top menu of Explorer) was C:\Users\My_name\.jupyter

    The second part of the answer can be implemented by simply pasting:

    import webbrowser
    webbrowser.register('firefox', None, webbrowser.GenericBrowser('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'))
    c.NotebookApp.browser = 'firefox'
    

    in the space on the space seen on the screen capture below, corresponding to the jupyter_notebook_config.py opened within PyCharm:

    ... only that I set it up to open in Opera:

    import webbrowser
    webbrowser.register('opera', None, webbrowser.GenericBrowser('C:\\Program Files (x86)\\Opera\\launcher.exe'))
    c.NotebookApp.browser = 'opera'
    

提交回复
热议问题