Last active
November 13, 2018 21:20
-
-
Save josh-howes/50e53f3ad52e11b2bc85fb6964147107 to your computer and use it in GitHub Desktop.
Revisions
-
josh-howes revised this gist
Sep 10, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,3 +17,7 @@ def noblock(line, cell): executor = None # use default future = async_loop.run_in_executor(executor, partial(ipy.run_cell, raw_cell=cell)) future.add_done_callback(alert_done) def alert_done(): """ Code to execute when the cell finishes running! """ pass -
josh-howes revised this gist
Sep 10, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ """ https://jupyter.readthedocs.io/en/latest/architecture/how_jupyter_ipython_work.html http://www.tornadoweb.org/en/stable/ https://jupyter-notebook.readthedocs.io/en/stable/extending/handlers.html """ from IPython import get_ipython from IPython.core.magic import register_cell_magic from tornado import ioloop -
josh-howes created this gist
Sep 10, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ from IPython import get_ipython from IPython.core.magic import register_cell_magic from tornado import ioloop from functools import partial @register_cell_magic def noblock(line, cell): """ Jupyter Magic to run cell code asynchronously """ async_loop = ioloop.IOLoop.instance() ipy = get_ipython() executor = None # use default future = async_loop.run_in_executor(executor, partial(ipy.run_cell, raw_cell=cell)) future.add_done_callback(alert_done)