Coverage for docs_src / progressbar / tutorial001_py39.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-02-09 12:36 +0000

1import time 1abcdefgh

2 

3import typer 1abcdefgh

4from rich.progress import track 1abcdefgh

5 

6app = typer.Typer() 1abcdefgh

7 

8 

9@app.command() 1abcdefgh

10def main(): 1abcdefgh

11 total = 0 1abcdefgh

12 for value in track(range(100), description="Processing..."): 1abcdefgh

13 # Fake processing time 

14 time.sleep(0.01) 1abcdefgh

15 total += 1 1abcdefgh

16 print(f"Processed {total} things.") 1abcdefgh

17 

18 

19if __name__ == "__main__": 1abcdefgh

20 app() 1abcdefgh