convert json ipython notebook(.ipynb) to .py file

Nitesh Selkari picture Nitesh Selkari · Jun 13, 2016 · Viewed 140.8k times · Source

How do you convert an IPython notebook file (json with .ipynb extension) into a regular .py module?

Answer

kikocorreoso picture kikocorreoso · Jun 13, 2016

From the notebook menu you can save the file directly as a python script. Go to the 'File' option of the menu, then select 'Download as' and there you would see a 'Python (.py)' option.

enter image description here

Another option would be to use nbconvert from the command line:

jupyter nbconvert --to script 'my-notebook.ipynb'

Have a look here.