Wednesday, August 14, 2019

Converting ipynb to python script

 Okay, this guy's stuff is old - too old :

https://medium.com/@researchplex/the-easiest-way-to-convert-jupyter-ipynb-to-python-py-912e39f16917

And fairly useless too, because he doesn't tell you you need to do

$ > python3 -m IPython nbconvert --to python name.ipynb

When you do that, python warns you and suggests using jupyter nbconvert (same arguments)

That actually works - and you also get the markdown as comments. If you'd rather not, then, there's :

https://stackoverflow.com/questions/37423380/ignore-markdown-cells-in-jupyter-nbconvert-with-to-script

No comments: