[Python-Dev] proposed which.py replacement

Stefan Rank list-ener at strank.info
Sun Apr 1 18:41:54 CEST 2007

on 01.04.2007 17:23 Guido van Rossum said the following:
> It's out of character for the standard library, since (regardless of
> whether it's implemented in Python or part of the standard library)
> it's a stand-alone utility. I don't see much use for this as a library
> module.

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

A small use case, but a use case nevertheless.

I never use which.py as a stand-alone utility as I have cygwin.
(But I think it would be helpful when deploying on somebody else's 
Windows computer.)

Of course it is your call if it fits in the stdlib or not.


More information about the Python-Dev mailing list