notify when execution/command is completed

后端 未结 5 606
无人共我
无人共我 2021-02-07 07:06

How do I get IPython to notify me when a command has been executed? Can I get it to use the bell/alert, or by pop-up? I\'m running Anaconda on iTerm on OS X 10.8.5.

5条回答
  •  [愿得一人]
    2021-02-07 07:42

    Finally someone created a nice library for it.

    You just install it:

    pip install jupyternotify
    

    Import it in your notebook:

    import jupyternotify
    ip = get_ipython()
    ip.register_magics(jupyternotify.JupyterNotifyMagics)
    

    and use a magic command:

    %%notify
    import time
    time.sleep(5)
    

    and get a nice notification:

    Git-page also shows how to load it automatically.

提交回复
热议问题