well,
1. you can leverage the tool (editor tools)
2. you can run the library code py_compile. example :
python -m py_compile script.py
References:
How can I check the syntax of python code without actually executing it.. : http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of-python-code-in-emacs-without-actually-executing-it
Python语法检查方法

本文介绍两种无需执行即可检查Python代码语法的方法:一是利用编辑器工具;二是运行库代码通过py_compile示例。这两种方法有助于开发者在实际运行前发现并修正语法错误。
1万+

被折叠的 条评论
为什么被折叠?



