Module app.widgets.console_helper
Classes
class ConsoleHelperWidget (working_dir=None, **kwargs)
-
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.
You can then use the widget as a context manager: any output produced while in the context will be captured and displayed in the widget instead of the standard output area.
You can also use the .capture() method to decorate a function or a method. Any output produced by the function will then go to the output widget. This is useful for debugging widget callbacks, for example.
Example:: import ipywidgets as widgets from IPython.display import display out = widgets.Output() display(out)
print('prints to output area') with out: print('prints to output widget') @out.capture() def func(): print('prints to output widget')
Public constructor
Ancestors
- ipywidgets.widgets.widget_output.Output
- ipywidgets.widgets.domwidget.DOMWidget
- ipywidgets.widgets.widget.Widget
- ipywidgets.widgets.widget.LoggingHasTraits
- traitlets.traitlets.HasTraits
- traitlets.traitlets.HasDescriptors