From f8363b456f1ab31ee56abad579b215af195093d5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 14 May 2024 22:18:28 +0200 Subject: Adding upstream version 9.11.0. Signed-off-by: Daniel Baumann --- examples/screen.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/screen.py (limited to 'examples/screen.py') diff --git a/examples/screen.py b/examples/screen.py new file mode 100644 index 0000000..90f1028 --- /dev/null +++ b/examples/screen.py @@ -0,0 +1,21 @@ +""" +Demonstration of Console.screen() +""" + +from time import sleep + +from rich.console import Console +from rich.align import Align +from rich.text import Text +from rich.panel import Panel + +console = Console() + +with console.screen(style="bold white on red") as screen: + for count in range(5, 0, -1): + text = Align.center( + Text.from_markup(f"[blink]Don't Panic![/blink]\n{count}", justify="center"), + vertical="middle", + ) + screen.update(Panel(text)) + sleep(1) -- cgit v1.2.3