Something like Perl's -c flag?
phd at phd.pp.ru
Mon Sep 3 10:41:17 CEST 2001
On Sun, 2 Sep 2001, Magnus Lie Hetland wrote:
MLH> "Oleg Broytmann" <phd at phd.pp.ru> wrote in message
MLH> news:mailman.999326826.29300.python-list at python.org...
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> > Just compile the script. Like this:
MLH> > import sys
MLH> > from py_compile import compile
MLH> > if len(sys.argv) <= 1:
MLH> > sys.exit(1)
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 http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list