How to check the syntax of Python script without execution
We can check the syntax of Python script without execution, using the following command.
#python -m py_compile scriptname
Where 'scriptname' is the name of the script that need to be verified.