Reputation: 367
I use Ipython Notebook for all python scripting and also making notes with markdown cells.
Sometime back I had downloaded my Ipython Notebook as xyz.py file using File>Download Notebook as .py file option.
Now I need to import the same xyz.py file back into Ipython Notebook.
How can I achieve this?
Have tried creating a new Notebook and in a cell ran
%load xyz.py
but it loads the raw contents of the file in a single cell. And does not render markdown cells and code cells content as it was there in the original Notebook.
Upvotes: 4
Views: 418
Reputation: 83768
As far as I understand the Python .py file export is one direction process as it loses information in the process.
If you wish to repopen the notebooks for edit use the native JSON (ipynb) format.
For now your option is to reconstruct the cells from the source code by hand.
Upvotes: 3