{ } Raw JSON

bundles / IPython 9.13.0 / IPython / core / magics / execution / ExecutionMagics / capture

function

IPython.core.magics.execution:ExecutionMagics.capture

source: /IPython/core/magics/execution.py :1541

Signature

def   capture ( self line cell )

Summary

::

Extended Summary

%capture [--no-stderr] [--no-stdout] [--no-display] [output]

run the cell, capturing stdout, stderr, and IPython's rich display() calls.

positional arguments:

output The name of the variable in which to store output. This is a utils.io.CapturedIO object with stdout/err attributes for the text of the captured output. CapturedOutput also has a show() method for displaying the output, and __call__ as well, so you can use that to

quickly display the output. If unspecified, captured output is discarded.

options:

--no-stderr Don't capture stderr. --no-stdout Don't capture stdout. --no-display Don't capture IPython's rich display.

Aliases

  • IPython.core.magics.ExecutionMagics.capture