Compile (but do not run) a Python script [duplicate] Compile (but do not run) a Python script [duplicate] python python

Compile (but do not run) a Python script [duplicate]


python -m py_compile script.py


You can use pylint to find syntax errors as well as more subtle errors, such as accessing undefined variables in some rarely-used conditional branch.