Excerpt

Python is a programming language that lets you work quickly and integrate systems more effectively.

Resources

FAQ

Use aiohttp and asyncio to run I/O coroutines concurrently

Example:

import aiohttp
import asyncio
 
async def get_9():
    async with aiohttp.ClientSession() as session:
        async with session.get('https://httpbin.org/delay/9') as response:
            await response.text()
            print("9 finished")
 
async def get_3():
    async with aiohttp.ClientSession() as session:
        async with session.get('https://httpbin.org/delay/3') as response:
            await response.text()
            print("3 finished")
 
async def main():
    await asyncio.gather(get_9(), get_3())
 
asyncio.run(main())

What is the “Zen of Python”?