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 browser tab and come back later. But when I do the kernel interrupts running.
I guess there is a workaround for this but I can't find it
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.