Coverage for docs_src / progressbar / tutorial005_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

4 

5app = typer.Typer() 1abcdefgh

6 

7 

8@app.command() 1abcdefgh

9def main(): 1abcdefgh

10 total = 0 1abcdefgh

11 with typer.progressbar(range(100), label="Processing") as progress: 1abcdefgh

12 for value in progress: 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