title: Making a tqdm progress bar for asyncio
body: <p>Am attempting a tqdm progress bar with asyncio tasks gathered. </p>
  
  <p>Want the progress bar to be progressively updated upon completion of a task. Tried the code:</p>
  
  <pre><code>import asyncio
  import tqdm
  import random
  
  async def factorial(name, number):
      f = 1
      for i in range(2, number+1):
          await asyncio.sleep(random.random())
          f *= i
      print(f"Task {name}: factorial {number} = {f}")
  
  async def tq(flen):
      for _ in tqdm.tqdm(range(flen)):
          await asyncio.sleep(0.1)
  
  async def main():
      # Schedule the three concurrently
  
      flist = [factorial("A", 2),
          factorial("B", 3),
          factorial("C", 4)]
  
      await asyncio.gather(*flist, tq(len(flist)))
  
  asyncio.run(main())
  </code></pre>
  
  <p>...but this simply completes the tqdm bar and then processes factorials.</p>
  
  <p>Is there a way to make the progress bar move upon completion of each asyncio task?</p>