2021-02-12 21:59:35 +00:00
|
|
|
"""
|
|
|
|
Demonstration of Console.screen()
|
|
|
|
"""
|
|
|
|
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
from rich.align import Align
|
2021-02-20 11:05:21 +00:00
|
|
|
from rich.console import Console
|
2021-02-12 21:59:35 +00:00
|
|
|
from rich.panel import Panel
|
|
|
|
|
|
|
|
console = Console()
|
|
|
|
|
2021-02-14 09:48:34 +00:00
|
|
|
with console.screen(style="bold white on red") as screen:
|
2021-02-20 11:05:21 +00:00
|
|
|
text = Align.center("[blink]Don't Panic![/blink]", vertical="middle")
|
|
|
|
screen.update(Panel(text))
|
|
|
|
sleep(5)
|