I just realized (after being prompted by the makers of BBEdit, a very fine programmers editor for the Mac) that Python doesn't appear to have a "check syntax only" switch, like Perl and other languages do have. They'd like to have this, for (you guessed it) their "check syntax" command. Is there a roundabout way to do this? And, if there isn't, is it okay if I have a look at adding one? Suggestions for a switch letter? -- - Jack Jansen <Jack.Jansen@oratrix.com> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman -
On Sat, May 04, 2002 at 10:21:28PM +0200, Jack Jansen wrote:
I just realized (after being prompted by the makers of BBEdit, a very fine programmers editor for the Mac) that Python doesn't appear to have a "check syntax only" switch, like Perl and other languages do have. They'd like to have this, for (you guessed it) their "check syntax" command.
Is there a roundabout way to do this?
pychecker.sf.net Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
They'd like to have this, for (you guessed it) their "check syntax" command.
Is there a roundabout way to do this?
pychecker.sf.net
Um, that does much more than syntax checking. Maybe nice to have but probably not what BBEdit wants. --Guido van Rossum (home page: http://www.python.org/~guido/)
Oh. I've been using python -c "import py_compile,sys;sys.stderr = sys.stdout;py_compile.compile('$file')" Is this better or worse? BArry -----Original Message----- From: python-dev-admin@python.org [mailto:python-dev-admin@python.org]On Behalf Of Fredrik Lundh Sent: 04 May 2002 22:20 To: Jack Jansen; python-dev@python.org Subject: Re: [Python-Dev] No "check syntax" command line option jack wrote:
Is there a roundabout way to do this?
python -c "compile(open('$filename').read(), '$filename', 'exec')" works with all versions. </F> _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev
I just realized (after being prompted by the makers of BBEdit, a very fine programmers editor for the Mac) that Python doesn't appear to have a "check syntax only" switch, like Perl and other languages do have. They'd like to have this, for (you guessed it) their "check syntax" command.
Is there a roundabout way to do this?
It should be trivial to write a script that uses the built-in function compile() on the text of a given module. No need to add another command line switch (that's not "the Python way" :-). --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (5)
-
Barry Scott
-
Fredrik Lundh
-
Guido van Rossum
-
Jack Jansen
-
Oleg Broytmann