python progress bar 3

Asked

Viewed 4,056 times

0

I’m trying to assemble a progress bar to tell the percentage of my Python script execution with varying different functions, however unsuccessfully how I would create such progress bar?

  • 2

    What have you tried? Is there some code that has partially worked?

1 answer

2


You can use the lib tqdm, it is suitable for this and its use is extremely simles, see an example:

>>> from tqdm import tqdm
>>> from time import sleep
>>> for i in tqdm(range(1000)):
...     sleep(0.01)

Just pass an iterable to the function tqdm and the Progress bar will be created automatically. There are other ways to work with this lib, from a look at documentation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.