python模块之sniffio

嗅探python用了哪个异步库

from sniffio import current_async_library
import trio
import asyncio

async def print_library():
    library = current_async_library()
    print("This is:", library)

# Prints "This is trio"
trio.run(print_library)

# Prints "This is asyncio"
asyncio.run(print_library())
posted @ 2019-01-03 20:53  公众号python学习开发  阅读(737)  评论(0编辑  收藏  举报