{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from __future__ import print_function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Jupyter" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We'll be using Jupyter for all of our examples -- this allows us to run python in a web-based notebook, keeping a history of input and output, along with text and images.\n", "\n", "For Jupyter help, visit:\n", "https://jupyter.readthedocs.io/en/latest/content-quickstart.html" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We interact with python by typing into _cells_ in the notebook. By default, a cell is a _code_ cell, which means that you can enter any valid python code into it and run it. Another important type of cell is a _markdown_ cell. This lets you put text, with different formatting (italics, bold, etc) that describes what the notebook is doing.\n", "\n", "You can change the cell type via the menu at the top, or using the shortcuts:\n", "\n", " * ctrl-m m : mark down cell\n", " * ctrl-m y : code cell" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Some useful short-cuts:\n", "\n", " * shift+enter = run cell and jump to the next (creating a new cell if there is no other new one)\n", " * ctrl+enter = run cell-in place\n", " * alt+enter = run cell and insert a new one below\n", "\n", "ctrl+m h lists other commands" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A \"markdown cell\" enables you to typeset LaTeX equations right in your notebook. Just put them in $ or $$:\n", "\n", "$$\\frac{\\partial \\rho}{\\partial t} + \\nabla \\cdot (\\rho U) = 0$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "