index modules | next | previous | Python » 3.8.5 Documentation » The Python Standard Library » Networking and Interprocess Communication » asyncio — Asynchronous I/O » | ¶ This section outlines high-level asyncio APIs to work with coroutines and Tasks. Coroutines Awaitables Running an asyncio Program Creating Tasks Sleeping Running Tasks Concurrently Shielding From Cancellation Timeouts Waiting Primitives Scheduling From Other Threads Introspection Task Object Generator-based Coroutines Coroutines ¶ Coroutines declared with the async/await syntax is the preferred way of writing asyncio applications. For example, the following snippet of code (requires Python 3.7+) prints “hello”, waits 1 second, and then prints “world”: >>> import asyncio >>> async def main (): ... print ( 'hello' ) ... await asyncio . sleep ( 1 ) ... print ( 'world' ) >>> a...