Need help in writing up a Python Syntax checker

Kay Schluehr kay.schluehr at gmx.net
Mon Jul 14 12:48:53 CEST 2008


On 14 Jul., 08:22, Kinokunya <kinoku... at gmail.com> wrote:
> Hi guys,
>
> My group and I will be working on our final year project, the scope to
> do a program/web-based application similar areas of functionalities
> like the PyLint and PyChecker; a Python syntax checker. We have no
> Python background, equipped only with some knowledge of Java and Dot
> net.

Python doesn't need a syntax checker. Syntax is checked by the parser
and the parser is exposed to the user by means of the parser module.
What you probably mean are *semantical* checks which are typical for
compilers: e.g. whether names are used with prior assignments of
values that cause runtime exceptions. These issues are in fact covered
by PyLint and PyChecker.

> We did some research on PyLint and found out that there are 2 common
> modules that PyLint & PyChecker are using, namely logilab-astng and
> logilab-common. I'm not really sure what these 2 modules are for.
>
> Quoted from the offical site,
>
>     The aim of this module (logilab-astng) is to provide a common base
> representation of python source code
>
> We're not really sure what they meant by common base representation of
> source codes.

Just switch to <MyPythonPath>\Scripts\  in your Vista installation

and type `easy_install pylint`. This shall install PyLint in the
directory

               <MyPythonPath>\lib\site-packages

Additionally a pylint.bat file is placed in the <MyPythonPath>\Scripts
\ directory.

Type `pylint --help` and you get more information about the
functionality of PyLint.





More information about the Python-list mailing list