Progress bars in Python

If you need to add a progress bar in a python script, while you slowly loop over some items: before starting creating your own, save your time and consider tqdm.

  • pip install tqdm

  • wrap your iterable: tqdm(iterable)

  • profit!

So for example, something like this:

      from tqdm import tqdm
      for pages in tqdm(mypages[myissue], unit='page'):
        process_my_page()

You can customize quite a lot of things (like labels, units, position, color, etc) so check the fine manual.

It is THAT simple!