Python interpreter check and exit?

mksql at my-deja.com mksql at my-deja.com
Thu Jul 13 17:40:54 EDT 2000


Answered my own question (did not use the right search terms on my
first few attempts). Found a post with a Unix shell script that does
the job. Here is my DOS/Win .BAT version for any who are interested
(checks a single file):

@python -c "from py_compile import compile; compile('%1')"


In article <8kl9mc$1e3$1 at nnrp1.deja.com>,
  mksql at my-deja.com wrote:
> Does the Python interpreter have a "check the syntax of the program
and
> then exit without executing it" mode or command line parameter, as
> in "Perl -c program.pl" ?
>
> PythonWin has this ability through the check function, but I would
like
> to apply it to other editors.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list