Newbie edit/compile/run cycle question

Matimus mccredie at gmail.com
Mon Dec 10 19:00:04 EST 2007


> 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.


better written:

python -mpy_compile FILENAME

also see compileall

Matt



More information about the Python-list mailing list