Find more than one error at once

J

Joseph Turian

Is it possible to coax python to find more than one error at once?

Thanks,
Joseph
 
D

Diez B. Roggisch

Joseph said:
Is it possible to coax python to find more than one error at once?

What kind of errors? Syntax-errors? Then use one of the python source
code analyzers, such as pylint or pychecker.

Diez
 
J

John Machin

Diez said:
What kind of errors? Syntax-errors? Then use one of the python source
code analyzers, such as pylint or pychecker.

I don't know about pylint, but "PyChecker works in a combination of
ways. First, it imports each module. If there is an import error, the
module cannot be processed." -- so it fails on the first syntax error.
For example:

C:\junk>type syntaxerrors.py
if foo = bar:
pass
foo = "unterminated
123 = foo

C:\junk>python -m pychecker.checker syntaxerrors.py
Processing syntaxerrors...
SyntaxError: invalid syntax (syntaxerrors.py, line 1)
if foo = bar:
^

Warnings...

syntaxerrors:1: NOT PROCESSED UNABLE TO IMPORT

C:\junk>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top