Python 3.4.3异步IO关键字语法错误
我想,终端输出值千言万语Python 3.4.3异步IO关键字语法错误,python,python-asyncio,Python,Python Asyncio,我想,终端输出值千言万语 [~] $ python Python 3.4.3 (default, Jun 22 2016, 16:03:29) [GCC 4.9.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import asyncio >>> async def fun(): File "<stdin>", line
[~] $ python
Python 3.4.3 (default, Jun 22 2016, 16:03:29)
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> async def fun():
File "<stdin>", line 1
async def fun():
^
SyntaxError: invalid syntax
async关键字是在Python 3.5中添加的。async关键字是在Python 3.5中添加的。在Python 3.5中引入了async和Wait语法
在Python3.4中,您需要使用@asyncio.coroutine decorator并从语法中获得收益 在Python 3.5中引入了异步和等待语法
在Python3.4中,您需要使用@asyncio.coroutine decorator并从语法中获得收益