Entry
Checking python code for syntax errors
Feb 26th, 2001 14:51
Rathindra Guha, Amedee Potier
The main issue with debugging python scripts is to get rid of the syntax
errors. They get reported only once when the corresponding module is
loaded.
There is an easy trick to force the checking without running the
application:
% cd deploy
% ./run python
>>> import compileall
>>> compileall.compile_dir('.')
That will compile (create pyc files) all the python files found under
deploy (recursively) and report any error found.