python: how to check syntax of python file/script without executing it? April 13, 2024 by Tarik You can check the syntax by compiling it: python -m py_compile script.py