Import after exporting .py file back to IPython Notebook

I am using Ipython Notebook for all python scripts and also for notes with markdown cells.

Sometime ago I downloaded my Ipython Notebook as a xyz.py file using File> Download Notebook as a .py file.

Now I need to import the same xyz.py file into Ipython Notebook.

How can I achieve this?

We tried to create a new notebook and in the cell

% load xyz.py

but loads the original content of the file into one cell. And does not display the cells of the cells and the contents of the code cells as it did in the original notebook.

+3


source to share


1 answer


As I understand it, exporting a Python.py file is a one-way process as it loses information in the process.

If you want to replace notebooks for editing use native JSON format (ipynb) .



Now your option is to manually restore the cells from the original code.

+3


source







All Articles