kernel.core.redirector_output_trap

Module: kernel.core.redirector_output_trap

Inheritance diagram for IPython.kernel.core.redirector_output_trap:

Trap stdout/stderr, including at the OS level. Calls a callback with the output each time Python tries to write to the stdout or stderr.

RedirectorOutputTrap

class IPython.kernel.core.redirector_output_trap.RedirectorOutputTrap(out_callback, err_callback)

Bases: IPython.kernel.core.output_trap.OutputTrap

Object which can trap text sent to stdout and stderr.

__init__()

out_callback : callable called when there is output in the stdout err_callback : callable called when there is output in the stderr

on_err_write()

Callback called when there is some Python output on stderr.

on_out_write()

Callback called when there is some Python output on stdout.

set()

Set the hooks: set the redirectors and call the base class.

unset()

Remove the hooks: call the base class and stop the redirectors.

Table Of Contents

Previous topic

kernel.core.prompts

Next topic

kernel.core.sync_traceback_trap

This Page