Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Created November 15, 2022 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/7a502d55e685e1c033594e86721b865f to your computer and use it in GitHub Desktop.
Save YiLi225/7a502d55e685e1c033594e86721b865f to your computer and use it in GitHub Desktop.
## With asyncio.TaskGroup
async def run_errands():
async with asyncio.TaskGroup() as tg:
for errand, (start_time, time_to_finish) in errandsDict.items():
tg.create_task(errands_log(errand,
start_time,
time_to_finish))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment