简体   繁体   English

PyCharm中的Python3语法

[英]Python3 syntax in PyCharm

I would like to use python3 syntax in PyCharm 2016.2 and have configured the interpreter to use python3.5. 我想在PyCharm 2016.2中使用python3语法并将解释器配置为使用python3.5。 The code runs fine when I execute it but PyCharm complains about python3 syntax that isn't supported in python2. 我执行它时代码运行正常,但PyCharm抱怨python2不支持python3语法。

How can I convince PyCharm that the python3 syntax is ok? 我如何说服PyCharm python3语法没问题?

Settings -> Editor -> Inspections -> Python -> Code compatibility inspection 设置 - >编辑器 - >检查 - > Python - >代码兼容性检查

Either disable it entirely or unselect Python 2.X 要么完全禁用它,要么取消选择Python 2.X.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM