Closed IPython Notebook that was running code

2024/10/18 15:07:55

How it works? I got some code running in an IPython Notebook. Some iterative work.

Accidentally I closed the browser with the running Notebook, but going back to the IPython Dashboard I see that this particular Notebook hasn't Shutdown, so if I open the Notebook again I see the [*] in front of my code that it was executing.

I even can hear my PC still running the code, but it doesn't return me any new output of the print statements.

Can I wait and eventually continue with the output, or my PC will still running my code, but it won't be accessible anymore?

Answer

When you start up ipython, it is essentially creating a web server that is running on a separate process. The code itself is running on the web server, or kernel. The web browser is simply one of several front-ends that can view and edit the code on the kernel.

This design allows ipython to separate the evaluation of code from the viewing and editing of code -- for example, I could access the same kernel via the web interface (ipython notebook), the console (ipython console), or the qt console interface (ipython qtconsole).

Your PC will continue to run the code, though I believe that the output requested by one frontend will not show on any other frontends using the same kernel (I'm not 100% certain about this though).

You can find more information here.

https://en.xdnf.cn/q/73120.html

Related Q&A

os.popen().read() - charmap decoding error

I have already read UnicodeDecodeError: charmap codec cant decode byte X in position Y: character maps to <undefined>. While the error message is similar, the code is completely different, becau…

multiprocessing numpy not defined error

I am using the following test code:from pathos.multiprocessing import ProcessingPool as Pool import numpydef foo(obj1, obj2):a = obj1**2b = numpy.asarray(range(1,5))return obj1, bif __name__ == __main_…

Convert mp4 sound to text in python

I want to convert a sound recording from Facebook Messenger to text. Here is an example of an .mp4 file send using Facebooks API: https://cdn.fbsbx.com/v/t59.3654-21/15720510_10211855778255994_5430581…

pandas map one column to the combination of two columns

I am working with a DataFrame which looks like thisList Numb Name 1 1 one 1 2 two 2 3 three 4 4 four 3 5 fiveand I am trying to compute…

Pyspark command not recognised

I have anaconda installed and also I have downloaded Spark 1.6.2. I am using the following instructions from this answer to configure spark for Jupyter enter link description hereI have downloaded and …

Sliding window in Python for GLCM calculation

I am trying to do texture analysis in a satellite imagery using GLCM algorithm. The scikit-image documentation is very helpful on that but for GLCM calculation we need a window size looping over the im…

Keras multi-label image classification with F1-score

I am working on a multi-label image classification problem with the evaluation being conducted in terms of F1-score between system predicted and ground truth labels.Given that, should I use loss="…

Thread safe locale techniques

Were currently writing a web application based on a threaded python web server framework (cherrypy) and would like to simultaneously support users from multiple locales.The locale module doesnt appear …

How to draw image from raw bytes using ReportLab?

All the examples I encounter in the internet is loading the image from url (either locally or in the web). What I want is to draw the image directly to the pdf from raw bytes.UPDATE:@georgexsh Here is …

How to speed up numpy code

I have the following code. In principle it takes 2^6 * 1000 = 64000 iterations which is quite a small number. However it takes 9s on my computer and I would like to run it for n = 15 at least.from __f…