h2non / paco

Small utility library for coroutine-driven asynchronous generic programming in Python
http://paco.rtfd.io
MIT License
202 stars 13 forks source link

how to combine pace and tqdm to see a progress bar? #45

Open zouhx11 opened 5 years ago

zouhx11 commented 5 years ago
names = list(location['fullname'])

async def get_location(name):
    try:
        return geocode(name, timeout=10)
    except:
        return None

result = await paco.map(get_location, tqdm(names[0:100]))
zouhx11 commented 5 years ago

I want to get geo location of each name, this code does give me a progress bar, but the bar changes once a request is sent out, what i want is the bar only changes when a request is done. How can I get coroutines from paco.map? Thx!