Skip to content

Instantly share code, notes, and snippets.

@natea
Created November 23, 2014 15:15
Show Gist options
  • Save natea/32458841446da2515bb7 to your computer and use it in GitHub Desktop.
Save natea/32458841446da2515bb7 to your computer and use it in GitHub Desktop.
iPython notebook test
{"metadata": {"kernelspec": {"display_name": "IPython (Python 3)", "name": "python3"}, "celltoolbar": "Raw Cell Format", "language_info": {"name": "python", "pygments_lexer": "ipython3", "mimetype": "text/x-python", "codemirror_mode": {"name": "ipython", "version": 3}}, "signature": "sha256:623a6d6d3900f4a65b9e1435f2519cae51fb96a440a9fd9961581622485a6f33"}, "cells": [{"cell_type": "markdown", "metadata": {}, "source": "# Introduction to Python"}, {"cell_type": "markdown", "metadata": {}, "source": "Let's write some code"}, {"cell_type": "markdown", "metadata": {}, "source": "## Python prompt"}, {"cell_type": "markdown", "metadata": {}, "source": "To start playing with Python, we need to open up a command line on your computer. You should have already knew how to do that -- you have learned it in the Intro to Command Line chapter.\n\nOnce you're ready, follow the instructions below.\n\nWe want to open up a Python console, so type in python3 and hit Enter."}, {"cell_type": "markdown", "metadata": {}, "source": "```\n$ python3\nPython 3.4.2 (...)\nType \"copyright\", \"credits\" or \"license\" for more information.\n>>>\n```"}, {"cell_type": "markdown", "metadata": {}, "source": "## Your first Python command! "}, {"cell_type": "markdown", "metadata": {}, "source": "After running the Python command, the prompt changed to >>>. For us this means that for now we may only use commands in the Python language. You don't have to type in >>> - Python will do that for you.\n\nIf you want to exit the Python console at any point, just type exit() or use the shortcut Ctrl + Z for Windows and Ctrl + D for Mac/Linux. Then you won't see >>> any longer.\n\nBut now, we don't want to exit the Python console. We want to learn more about it. Let's start with something really simple. For example, try typing some math, like 2 + 3 and hit Enter.\n\n "}, {"cell_type": "code", "metadata": {"trusted": true, "collapsed": false}, "outputs": [{"data": {"text/plain": "5"}, "metadata": {}, "output_type": "execute_result", "execution_count": 1}], "source": "2 + 3", "execution_count": 1}, {"cell_type": "raw", "metadata": {}, "source": ""}, {"cell_type": "code", "metadata": {"trusted": true, "collapsed": true}, "outputs": [], "source": "", "execution_count": null}], "nbformat_minor": 0, "nbformat": 4}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment