mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 10:08:40 +00:00
docs for spinner and status
This commit is contained in:
parent
be47b3f899
commit
df1dc1ddcb
10 changed files with 216 additions and 35 deletions
14
examples/status.py
Normal file
14
examples/status.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from time import sleep
|
||||
from rich.console import Console
|
||||
|
||||
console = Console()
|
||||
console.print()
|
||||
|
||||
tasks = [f"task {n}" for n in range(1, 11)]
|
||||
|
||||
with console.status("[bold green]Working on tasks...") as status:
|
||||
while tasks:
|
||||
task = tasks.pop(0)
|
||||
sleep(1)
|
||||
console.log(f"{task} complete")
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue