尝试运行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.