mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 01:58:24 +00:00
spinners example
This commit is contained in:
parent
949e1f72fb
commit
04b23b8ac7
1 changed files with 23 additions and 0 deletions
23
examples/spinners.py
Normal file
23
examples/spinners.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from time import sleep
|
||||
|
||||
from rich.columns import Columns
|
||||
from rich.panel import Panel
|
||||
from rich.live import Live
|
||||
from rich.text import Text
|
||||
from rich.spinner import Spinner, SPINNERS
|
||||
|
||||
all_spinners = Columns(
|
||||
[
|
||||
Spinner(spinner_name, text=Text(repr(spinner_name), style="green"))
|
||||
for spinner_name in sorted(SPINNERS.keys())
|
||||
],
|
||||
column_first=True,
|
||||
expand=True,
|
||||
)
|
||||
|
||||
with Live(
|
||||
Panel(all_spinners, title="Spinners", border_style="blue"),
|
||||
refresh_per_second=20,
|
||||
) as live:
|
||||
while True:
|
||||
sleep(0.1)
|
Loading…
Add table
Add a link
Reference in a new issue