pychecker checks files by executing them ??

Thomas Heller theller at python.net
Tue Jun 3 11:04:04 EDT 2003


Axel Kowald <kowald at molgen.mpg.de> writes:

> Hi,
> 
> I got pychecker and installed it on my w2k machine as described. It
> also seems to work, but when I do:
> 
> pychecker myFile.py   it actually "executes"  myFile.py, while
> checking it. Is this the correct behaviour??
> 
> Obviously I would like to check my scripts without executing them. Any
> idea what's going on ?
> 
pychecker imports them, not executes them. Protect the main function or
what it is in your case by the usual 'if __name__ == "__main__":' idiom
(which you should do anyway IMO), and you are fine.

Thomas




More information about the Python-list mailing list