|
|
|
|
@ -10,9 +10,27 @@ from .widget import DOMWidget
|
|
|
|
|
import sys
|
|
|
|
|
from IPython.utils.traitlets import Unicode, List
|
|
|
|
|
from IPython.display import clear_output
|
|
|
|
|
from IPython.testing.skipdoctest import skip_doctest
|
|
|
|
|
|
|
|
|
|
@skip_doctest
|
|
|
|
|
class Output(DOMWidget):
|
|
|
|
|
"""Displays multiple widgets in a group."""
|
|
|
|
|
"""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')"""
|
|
|
|
|
_view_name = Unicode('OutputView', sync=True)
|
|
|
|
|
|
|
|
|
|
def clear_output(self, *pargs, **kwargs):
|
|
|
|
|
|