[Python-Dev] proposed which.py replacement

skip at pobox.com skip at pobox.com
Sun Apr 1 19:56:50 CEST 2007

    Stefan> I use it as a library, because it encodes knowledge about
    Stefan> locating executables on different platforms, especially Windows.
    Stefan> Unixoids have which and the search is relatively
    Stefan> straightforward.  Windows searches paths in PATH and in the
    Stefan> registry, and uses PATHEXT, so, for me, the main benefit of
    Stefan> which.py is that it provides a which replacement on Windows that
    Stefan> takes these quirks into account.

I'll second that.  In SpamBayes we not so long ago added the ability to run
OCR software over images to try and identify image-based spam.  Needless to
say, we had to write fairly different bits of code on Unix v. Windows to
locate the gocr or ocrad executables.  Having something like a
platform-independent which available in Python would have made this aspect
of the code easier to write.


More information about the Python-Dev mailing list