making prompt_tolkit history search configurable
making prompt_tolkit history search configurable

File last commit:

r24132:ddfa1ba0
r24145:61a08c53
Show More
Beyond Plain Python.ipynb
2522 lines | 129.6 KiB | text/plain | TextLexer
/ examples / IPython Kernel / Beyond Plain Python.ipynb
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "cells": [
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# IPython: beyond plain Python"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When executing code in IPython, all valid Python syntax works as-is, but IPython provides a number of features designed to make the interactive experience more fluid and efficient."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## First things first: running code, getting help"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the notebook, to run a cell of code, hit `Shift-Enter`. This executes the cell and puts the cursor in the next cell below, or makes a new one if you are at the end. Alternately, you can use:\n",
" \n",
"- `Alt-Enter` to force the creation of a new cell unconditionally (useful when inserting new content in the middle of an existing notebook).\n",
"- `Control-Enter` executes the cell and keeps the cursor in the same cell, useful for quick experimentation of snippets that you don't need to keep permanently."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hi\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "print(\"Hi\")"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"Getting help:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"?"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"Typing `object_name?` will print all sorts of details about any object, including docstrings, function definition lines (for call arguments) and constructor details for classes."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import collections\n",
"collections.namedtuple?"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"collections.Counter??"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"*int*?"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"An IPython quick reference card:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%quickref"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Tab completion"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Min RK
add kernel metadata to example notebooks
r20278 "Tab completion, especially for attributes, is a convenient way to explore the structure of any object you’re dealing with. Simply type `object_name.<TAB>` to view the object’s attributes. Besides Python objects and keywords, tab completion also works on file and directory names."
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": null,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"collections."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## The interactive workflow: input, output, history"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"12"
]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 7,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"2+10"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"22"
]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 8,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"_+10"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"You can suppress the storage and rendering of output if you append `;` to the last cell (this comes in handy when plotting with matplotlib, for example):"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"10+20;"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"22"
]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 10,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"_"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"The output is stored in `_N` and `Out[N]` variables:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 11,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"_10 == Out[10]"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"And the last three have shorthands for convenience:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"last output: True\n",
"next one : 22\n",
"and next : 22\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "from __future__ import print_function\n",
"\n",
"print('last output:', _)\n",
"print('next one :', __)\n",
"print('and next :', ___)"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "-"
}
},
"outputs": [
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "'_10 == Out[10]'"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 13,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"In[11]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "'In[11]'"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 14,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"_i"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "'In[11]'"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 },
Min RK
upate exmaple notebooks to nbformat v4
r18669 "execution_count": 15,
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"_ii"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"last input: _ii\n",
"next one : _i\n",
"and next : In[11]\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "print('last input:', _i)\n",
"print('next one :', _ii)\n",
"print('and next :', _iii)"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 " 1: print(\"Hi\")\n",
Min RK
upate exmaple notebooks to nbformat v4
r18669 " 2: ?\n",
" 3:\n",
"import collections\n",
"collections.namedtuple?\n",
" 4: collections.Counter??\n",
" 5: *int*?\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"%history -n 1-5"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"**Exercise**\n",
"\n",
"Write the last 10 lines of history to a file named `log.py`."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Accessing the underlying operating system"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "/Users/minrk/dev/ip/mine/examples/IPython Kernel\r\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"!pwd"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"My current directory's files:\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 "['Animations Using clear_output.ipynb', 'Background Jobs.ipynb', 'Beyond Plain Python.ipynb', 'Capturing Output.ipynb', 'Cell Magics.ipynb', 'Custom Display Logic.ipynb', 'Index.ipynb', 'Old Custom Display Logic.ipynb', 'Plotting in the Notebook.ipynb', 'Raw Input in the Notebook.ipynb', 'Rich Output.ipynb', 'Script Magics.ipynb', 'SymPy.ipynb', 'Terminal Usage.ipynb', 'Third Party Rich Output.ipynb', 'Trapezoid Rule.ipynb', 'Working With External Code.ipynb', '__pycache__', 'data', 'example-demo.py', 'gui', 'ipython-completion.bash', 'ipython-get-history.py', 'ipython-qtconsole.desktop', 'ipython.desktop', 'mod.py', 'test.txt']\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"files = !ls\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 "print(\"My current directory's files:\")\n",
"print(files)"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "[Animations Using clear_output.ipynb, Background Jobs.ipynb, Beyond Plain Python.ipynb, Capturing Output.ipynb, Cell Magics.ipynb, Custom Display Logic.ipynb, Index.ipynb, Old Custom Display Logic.ipynb, Plotting in the Notebook.ipynb, Raw Input in the Notebook.ipynb, Rich Output.ipynb, Script Magics.ipynb, SymPy.ipynb, Terminal Usage.ipynb, Third Party Rich Output.ipynb, Trapezoid Rule.ipynb, Working With External Code.ipynb, __pycache__, data, example-demo.py, gui, ipython-completion.bash, ipython-get-history.py, ipython-qtconsole.desktop, ipython.desktop, mod.py, test.txt]\r\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"!echo $files"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "ANIMATIONS USING CLEAR_OUTPUT.IPYNB\r\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"!echo {files[0].upper()}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that all this is available even in multiline blocks:"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 22,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "00 - Animations Using clear_output\n",
"01 - Background Jobs\n",
"02 - Beyond Plain Python\n",
"03 - Capturing Output\n",
"04 - Cell Magics\n",
"05 - Custom Display Logic\n",
"06 - Index\n",
"07 - Old Custom Display Logic\n",
"08 - Plotting in the Notebook\n",
"09 - Raw Input in the Notebook\n",
"10 - Rich Output\n",
"11 - Script Magics\n",
"12 - SymPy\n",
"13 - Terminal Usage\n",
"14 - Third Party Rich Output\n",
"15 - Trapezoid Rule\n",
"16 - Working With External Code\n",
Min RK
upate exmaple notebooks to nbformat v4
r18669 "--\n",
"--\n",
"--\n",
"--\n",
"--\n",
"--\n",
"--\n",
"--\n",
"--\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 "--\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"import os\n",
"for i,f in enumerate(files):\n",
" if f.endswith('ipynb'):\n",
" !echo {\"%02d\" % i} - \"{os.path.splitext(f)[0]}\"\n",
" else:\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 " print('--')"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Beyond Python: magic functions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The IPyhton 'magic' functions are a set of commands, invoked by prepending one or two `%` signs to their name, that live in a namespace separate from your normal Python variables and provide a more command-like interface. They take flags with `--` and arguments without quotes, parentheses or commas. The motivation behind this system is two-fold:\n",
" \n",
"- To provide an orthogonal namespace for controlling IPython itself and exposing other system-oriented functionality.\n",
"\n",
"- To expose a calling mode that requires minimal verbosity and typing while working interactively. Thus the inspiration taken from the classic Unix shell style for commands."
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 23,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%magic"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Line vs cell magics:"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 24,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "10000 loops, best of 3: 19.3 µs per loop\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "%timeit list(range(1000))"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 25,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "100000 loops, best of 3: 2.78 µs per loop\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"%%timeit\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 "list(range(10))\n",
"list(range(100))"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Line magics can be used even inside code blocks:"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 26,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "size: 100 100000 loops, best of 3: 1.86 µs per loop\n",
"size: 200 100000 loops, best of 3: 2.49 µs per loop\n",
"size: 300 100000 loops, best of 3: 4.04 µs per loop\n",
"size: 400 100000 loops, best of 3: 6.21 µs per loop\n"
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "for i in range(1, 5):\n",
Min RK
upate exmaple notebooks to nbformat v4
r18669 " size = i*100\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 " print('size:', size, end=' ')\n",
" %timeit list(range(size))"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Magics can do anything they want with their input, so it doesn't have to be valid Python:"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 27,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "My shell is: /usr/local/bin/bash\n",
"My disk usage is:\n",
"Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n",
"/dev/disk1 233Gi 216Gi 16Gi 94% 56788108 4190706 93% /\n",
"devfs 190Ki 190Ki 0Bi 100% 656 0 100% /dev\n",
"map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\n",
"map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
}
],
"source": [
"%%bash\n",
"echo \"My shell is:\" $SHELL\n",
Min RK
pass on IPython Kernel example notebooks...
r20547 "echo \"My disk usage is:\"\n",
"df -h"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Another interesting cell magic: create any file you want locally from the notebook:"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 28,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
Min RK
pass on IPython Kernel example notebooks...
r20547 "Overwriting test.txt\n"
Min RK
upate exmaple notebooks to nbformat v4
r18669 ]
}
],
"source": [
"%%writefile test.txt\n",
"This is a test file!\n",
"It can contain anything I want...\n",
"\n",
"And more..."
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 29,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is a test file!\r\n",
"It can contain anything I want...\r\n",
"\r\n",
Brian E. Granger
Work on IPython Kernel notebooks.
r17503 "And more..."
]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"!cat test.txt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's see what other magics are currently defined in the system:"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 30,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"application/json": {
"cell": {
"!": "OSMagics",
"HTML": "Other",
"SVG": "Other",
"bash": "Other",
"capture": "ExecutionMagics",
"debug": "ExecutionMagics",
"file": "Other",
"html": "DisplayMagics",
"javascript": "DisplayMagics",
"latex": "DisplayMagics",
"perl": "Other",
"prun": "ExecutionMagics",
"pypy": "Other",
"python": "Other",
"python2": "Other",
"python3": "Other",
"ruby": "Other",
"script": "ScriptMagics",
"sh": "Other",
"svg": "DisplayMagics",
"sx": "OSMagics",
"system": "OSMagics",
"time": "ExecutionMagics",
"timeit": "ExecutionMagics",
"writefile": "OSMagics"
},
"line": {
"alias": "OSMagics",
"alias_magic": "BasicMagics",
"autocall": "AutoMagics",
"automagic": "AutoMagics",
"autosave": "KernelMagics",
"bookmark": "OSMagics",
"cat": "Other",
"cd": "OSMagics",
"clear": "KernelMagics",
"colors": "BasicMagics",
"config": "ConfigMagics",
"connect_info": "KernelMagics",
"cp": "Other",
"debug": "ExecutionMagics",
"dhist": "OSMagics",
"dirs": "OSMagics",
Min RK
pass on IPython Kernel example notebooks...
r20547 "doctest_mode": "BasicMagics",
Min RK
upate exmaple notebooks to nbformat v4
r18669 "ed": "Other",
"edit": "KernelMagics",
"env": "OSMagics",
"gui": "BasicMagics",
"hist": "Other",
"history": "HistoryMagics",
"install_default_config": "DeprecatedMagics",
"install_profiles": "DeprecatedMagics",
"killbgscripts": "ScriptMagics",
"ldir": "Other",
"less": "KernelMagics",
"lf": "Other",
"lk": "Other",
"ll": "Other",
"load": "CodeMagics",
"load_ext": "ExtensionMagics",
"loadpy": "CodeMagics",
"logoff": "LoggingMagics",
"logon": "LoggingMagics",
"logstart": "LoggingMagics",
"logstate": "LoggingMagics",
"logstop": "LoggingMagics",
"ls": "Other",
"lsmagic": "BasicMagics",
"lx": "Other",
"macro": "ExecutionMagics",
"magic": "BasicMagics",
"man": "KernelMagics",
"matplotlib": "PylabMagics",
"mkdir": "Other",
"more": "KernelMagics",
"mv": "Other",
Min RK
pass on IPython Kernel example notebooks...
r20547 "namespace": "Other",
Min RK
upate exmaple notebooks to nbformat v4
r18669 "notebook": "BasicMagics",
"page": "BasicMagics",
"pastebin": "CodeMagics",
"pdb": "ExecutionMagics",
"pdef": "NamespaceMagics",
"pdoc": "NamespaceMagics",
"pfile": "NamespaceMagics",
"pinfo": "NamespaceMagics",
"pinfo2": "NamespaceMagics",
"popd": "OSMagics",
"pprint": "BasicMagics",
"precision": "BasicMagics",
"profile": "BasicMagics",
"prun": "ExecutionMagics",
"psearch": "NamespaceMagics",
"psource": "NamespaceMagics",
"pushd": "OSMagics",
"pwd": "OSMagics",