How to create a progress bar in Python
Creating a progress bar is really useful if you have a long-running task and you'd like to know how far along you are. In this post we'll talk about two packages for creating progress bars in Python: tqdm and progressbar2. Creating a progress bar with Python's tqdm package Let's get started by installing tqdm. We can do that using pip: [code] pip install tqdm [/code] Once we have tqdm installed, it's straightforward to use. Essentially, we just need to wrap whatever object we're looping over (i.e. any object that is iterable) inside tqdm. Then, when the code runs, Python will print out a progress bar so that you can know how far along you are. [code lang="python"] from tqdm import tqdm result = 0 for i in tqdm(range(10000000)): result +=…