Gevent Creating Progress Bar With tqdm

Posted on 20-08-2020

tqdm is a library for showing progress bar on command line. Using it with gevent has problems. I managed to workaround with contextmanager and local .

The example mocks a network request and process data with seperate Greenlet. We link these Greenlets to update tqdm instance so it can print progress bar correctly.

Here is the sample code for using tqdm with gevent