Learn asyncio fundamentals: how event loops work, what coroutines are, and how to run async code in Python.
Tutorial series
Python Async
6 tutorials — follow in order for the best learning path.
- asyncio Basics: Event Loops and Coroutines
- Async Patterns: Gather, Wait, and Queues
Master asyncio.gather(), asyncio.wait(), and asyncio.Queue to handle concurrent async tasks in Python.
- Async HTTP with aiohttp
Make asynchronous HTTP requests in Python using aiohttp: sessions, timeouts, connection pooling, and error handling.
- Async File I/O with aiofiles in Python
Learn to read and write files asynchronously in Python using aiofiles, without blocking the asyncio event loop or your application's concurrency.
- Task Groups and Exception Handling
asyncio task groups with ExceptionGroup and except* in Python 3.11+ — concurrent coroutines that succeed or fail as a unit, no orphaned tasks.
- Structured Concurrency in Python
Structured concurrency in Python: how asyncio.TaskGroup, asyncio.timeout, and ExceptionGroup compose into a lifetime-safe model on 3.11+.