File: screen.py

package info (click to toggle)
rich 13.9.4-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,284 kB
  • sloc: python: 29,157; makefile: 29
file content (16 lines) | stat: -rw-r--r-- 357 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
Demonstration of Console.screen() 
"""

from time import sleep

from rich.align import Align
from rich.console import Console
from rich.panel import Panel

console = Console()

with console.screen(style="bold white on red") as screen:
    text = Align.center("[blink]Don't Panic![/blink]", vertical="middle")
    screen.update(Panel(text))
    sleep(5)