I made a file called reader on Jupiter notebook.
I want to import it as shown in the image below, but I get an error
Also, the saved one comes with .ipynb. What does this mean?
I would appreciate it if you could reply.
.ipynb is the jupyter notebook saved file format.If you open the contents with an editor (such as atom), you will find that this is a json format of the contents of the notebook, not a python script.
If you have any code you want to use from the notebook, you need to save it as a normal program in .py format and import it on the notebook.
(As far as I remember, if I didn't write a code like a charm, I wouldn't have been able to import the local file on the notebook, but I was able to import it without any problems, so I might have misremembered it.)
To extract and save only the python code portion from the contents of the notebook, it appears that you can retrieve File->Download as->python (.py) from the target notebook open.
© 2024 OneMinuteCode. All rights reserved.