摘要:
asyncio 常用函数分类整理 按用途分组,附简单作用+示例,结合刚才的协程代码理解。 前提: import asyncio 一、入口 & 事件循环(程序启停) 1. asyncio.run(coro) Python3.7+ 推荐,启动事件循环,运行主协程,循环结束自动关闭。 python asy 阅读全文
posted @ 2026-10-05 16:02
立体风
阅读(2)
评论(0)
推荐(0)
摘要:
代码完整分析 python import asyncio import time async def fetch_api(idx: int, delay: int): print(f"[{idx}] 开始请求...") # asyncio.sleep 模拟非阻塞 I/O await asyncio. 阅读全文
posted @ 2026-10-05 16:01
立体风
阅读(3)
评论(0)
推荐(0)

浙公网安备 33010602011771号