I used to use perl -c programfile
to check the syntax of a Perl program and then exit without executing it. Is there an equivalent way to do this for a Python script?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Save this as checker.py and run
python checker.py yourpyfile.py
.for some reason ( I am a py newbie ... ) the -m call did not work ...
so here is a bash wrapper func ...
You can use these tools:
Perhaps useful online checker PEP8 : http://pep8online.com/
You can check the syntax by compiling it: