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.

 

Leave a Reply

Your email address will not be published. Required fields are marked *