1

i have a python file and want to check syntax error without compiling. I know about 'compileall', 'py_compile' but these all compile the code.

moooeeeep
  • 31,622
  • 22
  • 98
  • 187
Bimlesh Sharma
  • 186
  • 4
  • 18

1 Answers1

4

So you'll need some static code analysis. There are several tools that can do so with Python:

Personally, I use Pylint. It is rather strict but with some minimal configuration you'll get quickly some useful feedback. It can be installed using pip:

pip install pylint
pylint <my_module>.py

There are some options to scan whole folders. Have a look at http://docs.pylint.org/run.html

Ketouem
  • 3,820
  • 1
  • 19
  • 29