Srini's Point of View

My thoughts on technology, food and other fancies…

Syntax Checking your python script without running it

This is a neat little trick to test your python code on the command line without running the script.

$ python -m py_compile yourpythonscript.py

All that command does is compile your python script and create a .pyc file. If there are any errors, you will see the errors be spit out.

Comments