vscode python2 print语句报红

问题如图所示,代码可以正常运行,但是pylint报E1601的错误是怎么回事(编辑器用的是Python2)
图片描述

回答:

https://pylint.readthedocs.io...
print statement used Used when a print statement is used (print is a function in Python 3) This message can’t be emitted when using Python >= 3.0.
在配置里面忽略E1601,或者

from __future__ import print_function

print('aaa')

回答:

python我还是推荐你用pycharm或者插件多样的Sublime Text

回答:

这应该是 py3 的语法检测吧。

回答:

还是在配置里忽略E1601错误了,毕竟写惯了python2,要改print的语法的话得改好多处

以上是 vscode python2 print语句报红 的全部内容, 来源链接: utcz.com/a/158731.html

回到顶部