vscode python2 print语句报红

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

阅读 9.8k
4 个回答

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的语法的话得改好多处

推荐问题