Format conversion

The Jupyter project includes a tool for format conversion called nbconvert. It is easy to invoke from the command line:

jupyter nbconvert <file>.ipynb

It leaves the original <file>.ipynb alone and produces as output <file>.html. For example, we can transform a previous example as follows:

(Ipython)-bash-4.1$ jupyter nbconvert notebook2.ipynb 
[NbConvertApp] Converting notebook notebook2.ipynb to html
[NbConvertApp] Writing 214390 bytes to notebook2.html
(Ipython)-bash-4.1$ ls
HelloWorld.ipynb  img7.png  notebook2.html  notebook2.ipynb  testnotebook.ipynb

This results in a 214K HTML file that displays as:

Format conversion

Note that the HTML preserves ...

Get Mastering IPython 4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.