Python异步asyncio快速实践模版

时间:2020-10-22 19:31:12   收藏:0   阅读:26

只是参考快速跑起来模版,细节或者封装流畅使用需要详细阅读aiohttp文档

1 import asyncio
2 
3 async def foo():
4        await print(bar)
5 
6 loop = asyncio.get_event_loop()
7 future = asyncio.ensure_future(foo())
8 loop.run_until_complete(future);

 

原文:https://www.cnblogs.com/cutesnow/p/13859283.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!