Tqdm, add progress bars to your scripts

Today we will see a very interesting python library, I have given me many ideas to improve my scripts and for that reason I decided to write about it.

It is a library that allows us to integrate a progress bar visual to our scripts in a fast and easy way so that our end users do not despair to wait some time consuming process. Let’s see how it works.


The installation is done using “pip”:

pip install tqdm

Basic use:

from time import sleep
from tqdm import tqdm

for i in tqdm ( range (1000)):
    sleep (0.01)

The result will be seen as follows:


Interesting right? For more examples of this library, visit its github repository:  https://github.com/tqdm/tqdm#hooks-and-callbacks

Leave a Reply