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]

任意のレンダー可能オブジェクトの自動更新ライブ表示をレンダリングします。

パラメータ
  • renderable (RenderableType, オプション) – ライブ表示するレンダー可能オブジェクト。デフォルトでは何も表示しません。

  • console (Console, オプション) – オプションの Console インスタンス。デフォルトは標準出力に書き込む内部 Console インスタンスです。

  • screen (bool, オプション) – 代替スクリーンモードを有効にします。デフォルトは False です。

  • auto_refresh (bool, オプション) – 自動更新を有効にします。無効にした場合、更新フラグを付けて refresh() または update() を呼び出す必要があります。デフォルトは True です。

  • refresh_per_second (float, オプション) – ライブ表示を更新する 1 秒あたりの回数。デフォルトは 4 です。

  • transient (bool, オプション) – 終了時にレンダー可能オブジェクトをクリアします (screen=True の場合は効果がありません)。デフォルトは False です。

  • redirect_stdout (bool, オプション) – print を使用できるように、標準出力のリダイレクトを有効にします。デフォルトは True です。

  • redirect_stderr (bool, オプション) – 標準エラーのリダイレクトを有効にします。デフォルトは True です。

  • vertical_overflow (VerticalOverflowMethod, オプション) – レンダリング可能なオブジェクトがコンソールに対して高すぎる場合の処理方法。デフォルトは "ellipsis" です。

  • get_renderable (Callable[[], RenderableType], オプション) – レンダリング可能オブジェクトを取得するためのオプションの呼び出し可能オブジェクト。デフォルトは None です。

property is_started: bool

ライブ表示が開始されたかどうかを確認します。

process_renderables(renderables)[source]

カーソルを復元し、進行状況を表示するためにレンダー可能オブジェクトを処理します。

パラメータ

renderables (List[ConsoleRenderable]) –

戻り値の型

List[ConsoleRenderable]

refresh()[source]

ライブレンダーの表示を更新します。

戻り値の型

なし

property renderable: Union[ConsoleRenderable, RichCast, str]

表示されているレンダー可能オブジェクトを取得します。

戻り値

表示されているレンダー可能オブジェクト

戻り値の型

RenderableType

start(refresh=False)[source]

ライブレンダリング表示を開始します。

パラメータ

**refresh** (*bool**, *オプション*) – 更新も行います。デフォルトは False です。*

戻り値の型

なし

stop()[source]

ライブレンダリング表示を停止します。

戻り値の型

なし

update(renderable, *, refresh=False)[source]

表示されているレンダー可能オブジェクトを更新します。

パラメータ
  • **renderable** (*RenderableType*) – 使用する新しいレンダー可能オブジェクト。*

  • **refresh** (*bool**, *オプション*) – 表示を更新します。デフォルトは False です。*

戻り値の型

なし