小编Try*_*Try的帖子

Asyncio事件循环已关闭

尝试运行docs中给出的asyncio hello world代码示例时:

import asyncio

async def hello_world():
    print("Hello World!")

loop = asyncio.get_event_loop()
# Blocking call which returns when the hello_world() coroutine is done
loop.run_until_complete(hello_world())
loop.close()
Run Code Online (Sandbox Code Playgroud)

我收到错误:

RuntimeError: Event loop is closed
Run Code Online (Sandbox Code Playgroud)

我使用的是python 3.5.3.

python python-asyncio

32
推荐指数
3
解决办法
2万
查看次数

标签 统计

python ×1

python-asyncio ×1