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

11 statements  

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

1import time 1abcdefghij

2 

3import typer 1abcdefghij

4from rich.progress import track 1abcdefghij

5 

6app = typer.Typer() 1abcdefghij

7 

8 

9@app.command() 1abcdefghij

10def main(): 1abcdefghij

11 total = 0 1abcdefghij

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

13 # Fake processing time 

14 time.sleep(0.01) 1abcdefghij

15 total += 1 1abcdefghij

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

17 

18 

19if __name__ == "__main__": 1abcdefghij

20 app() 1abcdefghij