visual-studio-codejupyter-notebookvscode-python

VSCode: How to export a python file that was imported from a Jupyter Notebook back to Jupyter format?


Probably a silly question, but I couldn't find it. Visual Studio Code editor has a really nice way to work with Jupyter Notebooks. I can edit the cells directly in vscode and run them. Now it would be easy to work with version control.

But I couldn't find a way to convert it back to a Notebook! How do I generate a notebook back from the generated python file?

I understand that the notebook wouldn't have the output cells in it.


Solution

  • There is an option in the interactive Python window that has the notebook output:

    Export option in interactive window

    This is really cool, now you can work in a Python file and have a really nice interface with your version configuration system (Git).

    Yes, it was a silly question :-)