#!/usr/bin/env python # coding: utf-8 # # IPython Notebook Basics # ## Project directory # * 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 # Notebook files: # # * Are just that - files (`.ipynb`) on your file system # * Contain JSON data # In[7]: import nbformat with open('Notebook Basics.ipynb') as f: nb = nbformat.v4.reads_json(f.read()) # In[9]: nb.cells[0:5] # * Embed code, Markdown text, LaTeX equations, images # * Are version control friendly: post your Notebooks on GitHub # * Can be viewed online by anyone at http://nbviewer.org # 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. # ## Overview of the UI # * Dashboard # * Notebook area and cells # * Menu # * Toolbar # ## Cell types # * Code # * Markdown # * Raw text # ## Keyboard shortcuts # * `Shift-Enter` to run a cell # * `Ctrl-Enter` to run a cell in place # * All other keyboard shortcuts have the form: `Ctrl-m ?` # * Show all keyboard shortcuts using `Ctrl-m h`