### Navigation

- index
- modules |
- next |
- previous |
- IPython v0.10 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__`(out=None, err=None)
  `add_to_message`(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 v0.10 documentation »
- The IPython API »