syntax checker in python

nn pruebauno at latinmail.com
Mon Aug 10 10:17:22 EDT 2009


On Aug 7, 4:39 pm, horos11 <horo... at gmail.com> wrote:
> ps - I just realized that it isn't enough to do:
>
> python -c 'import /path/to/script'
>
> since that actually executes any statement inside of the script
> (wheras all I want to do is check syntax)
>
> So - let me reprhase that - exactly how can you do a syntax check in
> python? Something like perl's -c:
>
>      perl -c script_name.p
>
> Ed

You might want to check PyFlakes; it doesn't execute scripts unlike
the others.

http://www.divmod.org/trac/wiki/DivmodPyflakes



More information about the Python-list mailing list