6
當試圖運行在文檔中給出的ASYNCIO的hello world代碼示例:ASYNCIO事件環路閉合
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()
我得到的錯誤:
RuntimeError: Event loop is closed
我使用Python 3.5.3。