Op Sun, 09 Dec 2007 01:11:28 +0000, schreef Jeremy C B Nicoll:

> What command (in XP) does one need to issue to syntax check a saved
> python script without running it?
> 
> Does a syntax check report all syntax errors or just the first one
> found?

python -c "import py_compile; py_compile.compile(r'FILENAME')"

... where FILENAME is the filename of the python script you want to check.

What this does in practice is (trying to) compile the source, and any 
errors or warnings will be reported.


-- 
JanC
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to