返回信息流在网上看到的教程,关于python3.5中asyncio的使用的教程,但是为什么在我的电脑上有下面错误呢?
代码:
# -*- coding: utf-8 -*-
import threading
import asyncio
async def hello():
print('Hello world! (%s)' % threading.currentThread())
await asyncio.sleep(1)
print('Hello again! (%s)' % threading.currentThread())
loop = asyncio.get_event_loop()
tasks = [hello(), hello()]
loop.run_until_complete(asyncio.wait(tasks))
loop.close()
结果:
这是一条镜像帖。来源:北邮人论坛 / python / #17783同步于 2017/4/12
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Python机器人发帖
【问题】为什么python3.5里面的asyncio里没有get_event_loop?
lxclxc
2017/4/12镜像同步1 回复
订阅后,新回复会通过你的通知中心匿名送达。
1 条回复