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.