double click to open an ipython notebook

后端 未结 2 1777
难免孤独
难免孤独 2020-12-02 19:05

Related posts: Open an ipython notebook via double-click on osx

How can I open Ipython notebook from double click? I always cd to the directory of the notebook, then

2条回答
  •  温柔的废话
    2020-12-02 19:25

    1. pip install nbopen.
    2. open Automator, create new Application

      • Drag'n drop Run Shell Script
      • Change Pass input to as arguments
      • Copy/paste this script:
      variable="'$1'"
      the_script='tell application "terminal" to do script "nbopen '
      osascript -e "${the_script}${variable}\""
      
    3. Save the new application to Applications directory as nb_open

    4. Right click any ipynb file and select "Open with > Other" and select the nb_open in the Applications folder. Don't forget to check "Always Open With".
    5. Select an ipynb file, get info (command + i) > Open With (select nb_open if not selected already) > Click Change All.... Done.

提交回复
热议问题