How to close IPython Notebook properly?

前端 未结 14 1167
渐次进展
渐次进展 2020-12-04 06:34

How to close IPython Notebook properly?

Currently, I just close the browser tabs and then use Ctrl+C in the terminal.
Unfortunately, neither e

14条回答
  •  盖世英雄少女心
    2020-12-04 07:32

    If you run jupyter in the background like me:

    jupyter notebook &> /dev/null &
    

    Then to exit jupyter completely, instead of Ctl-C, make an alias command:

    echo 'alias quitjupyter="kill $(pgrep jupyter)"' >> ~/.bashrc
    

    Restart your terminal. Kill all jupyter instances:

    quitjupyter
    

    Note: use double quotes inside of single quotes as shown above. The other way around will evaluate the expression before writing it to your .bashrc (you want to write the command itself not 'kill 1430' or whatever process number may be associated with a current jupyter instance). Of course you can use any alias you wish. I actually use 'qjup':

    echo 'alias qjup="kill $(pgrep jupyter)"' >> ~/.bashrc
    

    Restart your terminal. Kill all jupyter instances:

    qjup
    

提交回复
热议问题