Keep Jupyter notebook running after closing browser tab

后端 未结 5 2017
清歌不尽
清歌不尽 2020-12-23 11:31

I use Jupyter Notebook to run a series of experiments that take some time. Certain cells take way too much time to execute so it\'s normal that I\'d like to close the browse

5条回答
  •  滥情空心
    2020-12-23 12:16

    The simplest workaround to this seems to be the built-in cell magic %%capture:

    %%capture output
    # Time-consuming code here
    

    Save, close tab, come back later. The output is now stored in the output variable:

    output.show()
    

    This will show all interim print results as well as the plain or rich output cell.

提交回复
热议问题