I used to use perl -c <filename> 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?
perl -c <filename>
You can check the syntax by compiling it:
python -m py_compile script.py