MCPcopy
hub / github.com/Textualize/rich / display

Function display

rich/jupyter.py:84–95  ·  view source on GitHub ↗

Render segments to Jupyter.

(segments: Iterable[Segment], text: str)

Source from the content-addressed store, hash-verified

82
83
84def display(segments: Iterable[Segment], text: str) -> None:
85 """Render segments to Jupyter."""
86 html = _render_segments(segments)
87 jupyter_renderable = JupyterRenderable(html, text)
88 try:
89 from IPython.display import display as ipython_display
90
91 ipython_display(jupyter_renderable)
92 except ModuleNotFoundError:
93 # Handle the case where the Console has force_jupyter=True,
94 # but IPython is not installed.
95 pass
96
97
98def print(*args: Any, **kwargs: Any) -> None:

Callers 2

_write_bufferMethod · 0.85
refreshMethod · 0.85

Calls 2

_render_segmentsFunction · 0.85
JupyterRenderableClass · 0.85

Tested by

no test coverage detected