kernel.core.output_trap — IPython 0.10.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- IPython 0.10.2 documentation »
- The IPython API »

# kernel.core.output_trap

## Module: `kernel.core.output_trap`

Inheritance diagram for `IPython.kernel.core.output_trap`:

Trap stdout/stderr.

## `OutputTrap`

class `IPython.kernel.core.output_trap.` `OutputTrap`(out=None, err=None)

  Bases: `object`

  Object which can trap text sent to stdout and stderr.

  `__init__`()
  `add_to_message`()

    Add the text from stdout and stderr to the message from the interpreter to its listeners.

    Parameters : | message : dict

  `clear`()

    Clear out the buffers.

  `err_text`

    Return the text currently in the stderr buffer.

  `out_text`

    Return the text currently in the stdout buffer.

  `set`()

    Set the hooks.

  `unset`()

    Remove the hooks.

### Navigation

- index
- modules |
- next |
- previous |
- IPython 0.10.2 documentation »
- The IPython API »