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

4 

5app = typer.Typer() 1abcdefghij

6 

7 

8@app.command() 1abcdefghij

9def main(): 1abcdefghij

10 total = 0 1abcdefghij

11 with typer.progressbar(range(100)) as progress: 1abcdefghij

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