Compile without execute for syntax check?

Aahz Maruch aahz at
Tue Mar 14 00:39:45 CET 2000

In article <8a3437$er1$1 at>,
Bernhard Reiter <breiter at usf.Uni-Osnabrueck.DE> wrote:
>The python interpreter in the non inspecting mode(default) finds
>some python syntax errors directly before running the code.
>Call me old fashioned, but the documentation is not clear about how
>to use this build-in syntax check on scripts without executing them.
>Nothing in the FAQ ether.

See FAQ entry 4.49, sort of.  What that doesn't tell you is that simply
doing an import of a module will produce the .pyc (and incidentally
perform the syntax check you request).  I may write a FAQ entry
explaining this in a bit more detail.
                      --- Aahz (Copyright 2000 by aahz at

Androgynous poly kinky vanilla queer het    <*>
Hugs and backrubs -- I break Rule 6

Three sins: BJ, B&J, B&J  --Aahz

More information about the Python-list mailing list