如何在Emacs中检查Python代码的语法,而不实际执行它? [英] How can I check the syntax of Python code in Emacs without actually executing it?

查看:133
本文介绍了如何在Emacs中检查Python代码的语法,而不实际执行它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python的IDLE具有检查模块(Alt-X),以检查可以调用的语法,无需运行代码。在Emacs中是否有同等的方法,而不是运行和执行代码?

Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?

推荐答案

您可以使用Pyflakes和Flymake ,以便在您的python代码有效时立即通知(并避免了很少有常见的陷阱)。

You can use Pyflakes together with Flymake in order to get instant notification when your python code is valid (and avoids a few common pitfalls as well).

这篇关于如何在Emacs中检查Python代码的语法,而不实际执行它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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