rich.live¶
- class rich.live.Live(renderable=None, *, console=None, screen=False, auto_refresh=True, refresh_per_second=4, transient=False, redirect_stdout=True, redirect_stderr=True, vertical_overflow='ellipsis', get_renderable=None)[source]¶
Renders an auto-updating live display of any given renderable.
- Parameters
renderable (RenderableType, optional) – The renderable to live display. Defaults to displaying nothing.
console (Console, optional) – Optional Console instance. Default will an internal Console instance writing to stdout.
screen (bool, optional) – Enable alternate screen mode. Defaults to False.
auto_refresh (bool, optional) – Enable auto refresh. If disabled, you will need to call refresh() or update() with refresh flag. Defaults to True
refresh_per_second (float, optional) – Number of times per second to refresh the live display. Defaults to 4.
transient (bool, optional) – Clear the renderable on exit (has no effect when screen=True). Defaults to False.
redirect_stdout (bool, optional) – Enable redirection of stdout, so
print
may be used. Defaults to True.redirect_stderr (bool, optional) – Enable redirection of stderr. Defaults to True.
vertical_overflow (VerticalOverflowMethod, optional) – How to handle renderable when it is too tall for the console. Defaults to “ellipsis”.
get_renderable (Callable[[], RenderableType], optional) – Optional callable to get renderable. Defaults to None.
- process_renderables(renderables)[source]¶
Process renderables to restore cursor and display progress.
- Parameters
renderables (List[ConsoleRenderable]) –
- Return type
- property renderable: Union[ConsoleRenderable, RichCast, str]¶
Get the renderable that is being displayed
- Returns
Displayed renderable.
- Return type
RenderableType