📅 2019-Dec-28 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cheatsheet, jupyter ⬩ 📚 Archive
foobar.ipynb
as a text file named foobar.txt
:$ jupyter nbconvert --to script foobar.ipynb
The output text file will only have the Python code from the notebook and will not have all the explanatory text.
This will drop all the explanatory text that might have been in the notebook.
foobar.ipynb
to a Python file named foobar.py
:$ jupyter nbconvert --to python foobar.ipynb
The output Python file will have the Python code from the notebook interspersed with the explanatory text from the notebook added as Python comments.
Tried with: Jupyter 4.4.0 and Ubuntu 18.04