Something like Perl's -c flag?

Oleg Broytmann phd at
Mon Sep 3 10:41:17 CEST 2001


On Sun, 2 Sep 2001, Magnus Lie Hetland wrote:
MLH> "Oleg Broytmann" <phd at> wrote in message
MLH> news:mailman.999326826.29300.python-list at
MLH> > On 31 Aug 2001, Mark Atwood wrote:
MLH> > MA> Does the Python interpreter have anything like Perl's -c flag, which
MLH> > MA> does a static syntax and sanity check without actually running the
MLH> > MA> script?
MLH> >
MLH> >    Just compile the script. Like this:
MLH> >
MLH> > import sys
MLH> > from py_compile import compile
MLH> >
MLH> > if len(sys.argv) <= 1:
MLH> >    sys.exit(1)
MLH> >
MLH> > for file in sys.argv[1:]:
MLH> >    compile(file)
MLH> You could also use pythonc, of course.

   What is "pythonc"? The only pythonc I know is PythonC - current CPython

     Oleg Broytmann              phd at
           Programmers don't die, they just GOSUB without RETURN.

More information about the Python-list mailing list