Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: html.widgets.widget_output

Output class.

Represents a widget that can be used to display output within the widget area.

1 Class

class IPython.html.widgets.widget_output.Output(*pargs, **kwargs)

Bases: IPython.html.widgets.widget.DOMWidget

Widget used as a context manager to display output.

This widget can capture and display stdout, stderr, and rich output. To use it, create an instance of it and display it. Then use it as a context manager. Any output produced while in it’s context will be captured and displayed in it instead of the standard output area.

Example

from IPython.html import widgets from IPython.display import display out = widgets.Output() display(out)

print(‘prints to output area’)

with out:
print(‘prints to output widget’)