Coroutines and Tasks - Python 3.11.0 documentation
This section outlines high-level asyncio APIs to work with coroutines and Tasks. Coroutines declared with the async/await syntax is the preferred way of writing asyncio applications. For example, the following snippet of code prints "hello", waits 1 second, and then prints "world": Note that simply calling a coroutine will not schedule it to be executed: To actually run a coroutine, asyncio provides the following mechanisms: Awaiting on a coroutine.