IPython Notebooks are just files (.ipynb
) on your file system
The Notebook server is aware of Notebooks in a single directory, which we call the Notebook directory
If you cd to a Notebook directory and type:
jupyter notebook
you will see the Notebooks in that directory in the dashboard
Notebook files:
.ipynb
) on your file systemimport nbformat
with open('Notebook Basics.ipynb') as f:
nb = nbformat.v4.reads_json(f.read())
nb.cells[0:5]
[{u'cell_type': u'markdown', u'metadata': {u'slideshow': {u'slide_type': u'slide'}}, u'source': u'# IPython Notebook Basics'}, {u'cell_type': u'markdown', u'metadata': {}, u'source': u'## Project directory'}, {u'cell_type': u'markdown', u'metadata': {}, u'source': u'* IPython Notebooks are just files (`.ipynb`) on your file system\n* The Notebook server is aware of Notebooks in a single directory, which we call the **Notebook directory**\n* If you cd to a Notebook directory and type:\n\n jupyter notebook\n\n you will see the Notebooks in that directory in the dashboard'}, {u'cell_type': u'markdown', u'metadata': {u'slideshow': {u'slide_type': u'slide'}}, u'source': u'## Notebook files'}, {u'cell_type': u'markdown', u'metadata': {}, u'source': u'Notebook files:\n\n* Are just that - files (`.ipynb`) on your file system\n* Contain JSON data'}]
IPython Notebooks can also be exported to .py
files (see "File:Download As" menu item). You can tell the Notebook server to always save these .py
files alongside the .ipynb
files by starting the Notebook as:
ipython notebook --script
You can import Notebooks from the main Dashboard or simply by copying a Notebook into the Notebook directory.
Shift-Enter
to run a cellCtrl-Enter
to run a cell in placeCtrl-m ?
Ctrl-m h