mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 01:58:24 +00:00
docs and tests
This commit is contained in:
parent
d89c29200b
commit
7edf183bed
5 changed files with 97 additions and 21 deletions
|
@ -6,15 +6,16 @@ from time import sleep
|
|||
|
||||
from rich.console import Console
|
||||
from rich.align import Align
|
||||
from rich.screen import Screen
|
||||
from rich.text import Text
|
||||
from rich.panel import Panel
|
||||
|
||||
console = Console()
|
||||
|
||||
with console.screen():
|
||||
panel = Panel(
|
||||
Align.center("[blink]Don't Panic!", vertical="middle"),
|
||||
style="bold white on red",
|
||||
)
|
||||
console.print(Screen(panel), end="")
|
||||
sleep(5)
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue