[Python] How to await a list of tasks in python?

Discussão em 'Python' iniciado por Stack, Setembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    In .Net C#, there is a function Task.WhenAll that can take a list of tasks to await them. What should I use in python? I am trying to do the same with this:

    tasks = ... # list of coroutines

    for task in tasks:
    await task

    Continue reading...

Compartilhe esta Página