Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.4.3异步IO关键字语法错误_Python_Python Asyncio - Fatal编程技术网

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并从语法中获得收益