NetBeans抱怨,但是代码运行 [英] NetBeans complains, but the code runs

查看:90
本文介绍了NetBeans抱怨,但是代码运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是python的新手.我正在用NetBeans编写程序.

I am new to python. I am writing programs in NetBeans.

  • NetBeans 8.1
  • NetBeans的Python插件
  • Python 3.5.1
  • 插件设置为3.5.1,而不是默认的2.7

我写语句时NetBeans抱怨

NetBeans complains when I write the statement

print ("_ ", end='')

错误是

no viable alternative at input '='

看来NetBeans正在检查2.7语法,而不是3.5.我能够运行代码,因此NetBeans使用3.5执行.

It appears that NetBeans is checking for 2.7 syntax, instead of 3.5. I am able to run the code, so NetBeans is using 3.5 to execute.

如何配置NetBeans,以便它使用正确的语法检查?

How do I configure NetBeans so it uses the correct syntax checking?

在@alecxe的推荐之后,我向NetBeans报告了一个错误.

After the recommendation of @alecxe, I reported a bug to NetBeans.

NetBeans不支持python3.x.该插件运行正确的版本,但是IDE语法检查链接到2.x.

NetBeans does not support python 3.x. The plugin runs the correct version, but the IDE syntax checking is linked to 2.x.

感谢您的举报.请注意,我们不正式支持 Python 3.x尚未.但是,这在我们的nbPython上是一项非常重要的任务 吉拉董事会...将此错误标记为重复.建议您关注 错误#229940 进行通知.

Thank you for your report. Note that we do not officially support Python 3.x yet. However, It is a high-importance task on our nbPython Jira board... Marking this bug as Duplicate. Suggest you follow Bug#229940 for notification.

PS. PyCharm很棒.

PS. PyCharm is great.

推荐答案

问题在我这一端也可以重现.即使默认的Python Environment设置为Python3.5,并且Project Interpreter也设置为Python3.5,它仍然使用Python2特定的语法检查.例如,如果print用作语句而不是功能,则不会突出显示print:

The problem is reproducible on my end too. Even if the default Python Environment is set to Python3.5 and the Project Interpreter is also set to Python3.5, it still uses Python2 specific syntax checks. For example, it does not highlight the print if it is used as a statement and not function:

我不认为此特定行为是可配置的,并且这是一个错误(我怀疑捆绑的Jython用于实时"语法检查).您绝对应该提交问题

I don't think this particular behavior is configurable and this is a bug (I suspect the bundled Jython is used for the "live" syntax checking). You should definitely file an issue here.

PyLint这样的外部工具可能会有所帮助,但尚未集成.

External tools like PyLint might help, but it is not yet integrated.

而且,PyCharm具有完全免费的社区版本.

这篇关于NetBeans抱怨,但是代码运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆