mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
327 lines
26 KiB
Plaintext
327 lines
26 KiB
Plaintext
|
{
|
||
|
"metadata": {
|
||
|
"name": ""
|
||
|
},
|
||
|
"nbformat": 3,
|
||
|
"nbformat_minor": 0,
|
||
|
"worksheets": [
|
||
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "heading",
|
||
|
"level": 1,
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Basic Output"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"from IPython.display import display"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"prompt_number": 11
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"print 'hi'"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"output_type": "stream",
|
||
|
"stream": "stdout",
|
||
|
"text": [
|
||
|
"hi\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 12
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"display('hi')"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data",
|
||
|
"text": [
|
||
|
"'hi'"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 13
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"1"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"metadata": {},
|
||
|
"output_type": "pyout",
|
||
|
"prompt_number": 14,
|
||
|
"text": [
|
||
|
"1"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 14
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"%matplotlib inline\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"plt.plot([1,3,2])"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"metadata": {},
|
||
|
"output_type": "pyout",
|
||
|
"prompt_number": 5,
|
||
|
"text": [
|
||
|
"[<matplotlib.lines.Line2D at 0x10a1da150>]"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data",
|
||
|
"png": "iVBORw0KGgoAAAANSUhEUgAAAloAAAF8CAYAAAAXRhVcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VHW+//H3TJJJ7yGEJKQQCIkgIqJSREFQFxVU4O51\ny3UboMCyFtbCKgro2hFRUQS23L3+1lsAFVZBEpoKFiCCAgkBkpBGCOmFhJQ5vz92l4cuLYFMzpTX\n8y9NZiZv5OTM2+98zvlaDMMwBAAAgC5nNTsAAACAu6JoAQAAOAhFCwAAwEEoWgAAAA5C0QIAAHAQ\nihYAAICDeF/oAW+99ZZycnJksVjk4+Ojn/3sZxo4cOAZjyspKdFbb72l+vp6hYSEaMaMGYqNjXVI\naAAAAFdgudB9tL799lsNGDBAVqtVWVlZeuedd/TKK6+c8bgHH3xQv/jFLzRo0CBlZWVp1apVevbZ\nZx0WHAAAwNld8KPDyy+/XFarVYZhqLS0VMnJyWc85sSJE2pqatKgQYMkSUOGDFFFRYVqamq6PjEA\nAICL6NCMVk5OjqZPn65t27bpJz/5yRnfr6qqUnBw8Pe+Fhoaqqqqqq5JCQAA4II6VLTS0tK0YsUK\n/eQnP9GCBQvO/kLWM1+qra3t0tIBAA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WgB6LS65jYtyMzTvdfGKbVHgNlxcAEWi0Xj+kVoxZR02Q1DU1dna8uRajaqBroBRQtAp7TbDf1+\nc4FGJIZpXL8Is+OgE4J9vXX/dQl6cmwf/c/eMs3dcEQltc1mxwLcGkULQKes/KpEFov0q6tjzY6C\ni3RZz0AtvTNNQ+OCdf/aXL2T
|
||
|
"text": [
|
||
|
"<matplotlib.figure.Figure at 0x10a2b5790>"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 5
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"%%javascript\n",
|
||
|
"console.log(\"I ran!\");"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"javascript": [
|
||
|
"console.log(\"I ran!\");"
|
||
|
],
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data",
|
||
|
"text": [
|
||
|
"<IPython.core.display.Javascript at 0x10aae8310>"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 20
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"%%html\n",
|
||
|
"<b>bold</b>"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"html": [
|
||
|
"<b>bold</b>"
|
||
|
],
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data",
|
||
|
"text": [
|
||
|
"<IPython.core.display.HTML at 0x10aae80d0>"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 21
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"%%latex\n",
|
||
|
"$$\n",
|
||
|
"a = 5\n",
|
||
|
"$$"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"latex": [
|
||
|
"$$\n",
|
||
|
"a = 5\n",
|
||
|
"$$"
|
||
|
],
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data",
|
||
|
"text": [
|
||
|
"<IPython.core.display.Latex at 0x10aae8310>"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 22
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "heading",
|
||
|
"level": 1,
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"input_request"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"raw_input(\"prompt > \")"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"stream": "stdout",
|
||
|
"text": [
|
||
|
"prompt > 1\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"metadata": {},
|
||
|
"output_type": "pyout",
|
||
|
"prompt_number": 1,
|
||
|
"text": [
|
||
|
"'1'"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 1
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "heading",
|
||
|
"level": 1,
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"set_next_input"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"%%writefile tst.py\n",
|
||
|
"def foo():\n",
|
||
|
" pass\n"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"output_type": "stream",
|
||
|
"stream": "stdout",
|
||
|
"text": [
|
||
|
"Overwriting tst.py\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"prompt_number": 2
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"%load tst.py"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"prompt_number": 3
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "heading",
|
||
|
"level": 1,
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Pager in execute_reply"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"plt?"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"prompt_number": 9
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "heading",
|
||
|
"level": 1,
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"object_info"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"# press tab after parentheses\n",
|
||
|
"int("
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "heading",
|
||
|
"level": 1,
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"complete"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"collapsed": false,
|
||
|
"input": [
|
||
|
"# pres tab after f\n",
|
||
|
"f"
|
||
|
],
|
||
|
"language": "python",
|
||
|
"metadata": {},
|
||
|
"outputs": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {}
|
||
|
}
|
||
|
]
|
||
|
}
|