making prompt_tolkit history search configurable
making prompt_tolkit history search configurable

File last commit:

r20547:8f4e2b41
r24145:61a08c53
Show More
Capturing Output.ipynb
505 lines | 19.2 KiB | text/plain | TextLexer
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "cells": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "cell_type": "markdown",
"metadata": {},
"source": [
"# Capturing Output With <tt>%%capture</tt>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"IPython has a [cell magic](Cell Magics.ipynb), `%%capture`, which captures the stdout/stderr of a cell. With this magic you can discard these streams or store them in a variable."
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 1,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"import sys"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By default, `%%capture` discards these streams. This is a simple way to suppress unwanted output."
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 2,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%capture\n",
"print('hi, stdout')\n",
"print('hi, stderr', file=sys.stderr)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you specify a name, then stdout/stderr will be stored in an object in your namespace."
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 3,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%capture captured\n",
"print('hi, stdout')\n",
"print('hi, stderr', file=sys.stderr)"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 4,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
"<IPython.utils.capture.CapturedIO at 0x1076c9310>"
]
},
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 4,
Brian Granger
First go and reorganizing the examples.
r9191 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"captured"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Calling the object writes the output to stdout/stderr as appropriate."
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 5,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "name": "stdout",
"output_type": "stream",
"text": [
"hi, stdout\n"
Brian Granger
First go and reorganizing the examples.
r9191 ]
},
{
Min RK
upate exmaple notebooks to nbformat v4
r18669 "name": "stderr",
"output_type": "stream",
"text": [
"hi, stderr\n"
Brian Granger
First go and reorganizing the examples.
r9191 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"captured()"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 6,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
"'hi, stdout\\n'"
]
},
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 6,
Brian Granger
First go and reorganizing the examples.
r9191 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"captured.stdout"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 7,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
"'hi, stderr\\n'"
]
},
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 7,
Brian Granger
First go and reorganizing the examples.
r9191 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"captured.stderr"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`%%capture` grabs all output types, not just stdout/stderr, so you can do plots and use IPython's display system inside `%%capture`"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 8,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 9,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%capture wontshutup\n",
"\n",
"print(\"setting up X\")\n",
"x = np.linspace(0,5,1000)\n",
"print(\"step 2: constructing y-data\")\n",
"y = np.sin(x)\n",
"print(\"step 3: display info about y\")\n",
"plt.plot(x,y)\n",
"print(\"okay, I'm done now\")"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 10,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "name": "stdout",
"output_type": "stream",
"text": [
"setting up X\n",
"step 2: constructing y-data\n",
"step 3: display info about y\n",
"okay, I'm done now\n"
Brian Granger
First go and reorganizing the examples.
r9191 ]
},
{
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"image/png": [
"iVBORw0KGgoAAAANSUh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
"<matplotlib.figure.Figure at 0x10866ae90>"
]
},
Brian Granger
First go and reorganizing the examples.
r9191 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "display_data"
}
],
"source": [
"wontshutup()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And you can selectively disable capturing stdout, stderr or rich display, by passing `--no-stdout`, `--no-stderr` and `--no-display`"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 11,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "name": "stderr",
"output_type": "stream",
"text": [
"hello, stderr\n"
Brian Granger
First go and reorganizing the examples.
r9191 ]
Min RK
upate exmaple notebooks to nbformat v4
r18669 }
],
"source": [
"%%capture cap --no-stderr\n",
"print('hi, stdout')\n",
"print(\"hello, stderr\", file=sys.stderr)"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 12,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
"'hi, stdout\\n'"
]
},
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 12,
Brian Granger
First go and reorganizing the examples.
r9191 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"cap.stdout"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 13,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Brian Granger
First go and reorganizing the examples.
r9191 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
"''"
]
},
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 13,
Brian Granger
First go and reorganizing the examples.
r9191 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
}
],
"source": [
"cap.stderr"
]
},
{
"cell_type": "code",
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 14,
Min RK
upate exmaple notebooks to nbformat v4
r18669 "metadata": {
"collapsed": false
},
"outputs": [
Paul Ivanov
updated Basic Output notebook with new %%capture
r12226 {
Min RK
upate exmaple notebooks to nbformat v4
r18669 "data": {
"text/plain": [
"[]"
]
},
Min RK
pass on IPython Kernel example notebooks...
r20547 "execution_count": 14,
Paul Ivanov
updated Basic Output notebook with new %%capture
r12226 "metadata": {},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "output_type": "execute_result"
Brian Granger
First go and reorganizing the examples.
r9191 }
],
Min RK
upate exmaple notebooks to nbformat v4
r18669 "source": [
"cap.outputs"
]
Brian Granger
First go and reorganizing the examples.
r9191 }
Min RK
upate exmaple notebooks to nbformat v4
r18669 ],
Min RK
add kernel metadata to example notebooks
r20278 "metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.2"
}
},
Min RK
upate exmaple notebooks to nbformat v4
r18669 "nbformat": 4,
"nbformat_minor": 0
Min RK
add kernel metadata to example notebooks
r20278 }