Keep Jupyter notebook running after closing browser tab

后端 未结 5 1997
清歌不尽
清歌不尽 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:20

    If you've set all cells to run and want to periodically check what's being printed, the following code would be a better option than %%capture. You can always open up the log file while kernel is busy.

    import sys
    sys.stdout = open("my_log.txt", "a")
    

提交回复
热议问题