Python equivalent to 'which'?

Trent Mick trentm at ActiveState.com
Tue Jul 30 13:55:04 EDT 2002


[eg wrote]
> Is their a python equivalent to the bash shell command 'which'?  I
> haven't found it, and 'which' is such a common word that it may be
> lost in the noise in my dejanews searches :(
> 
> I could grab the PATH environment variable and walk all the paths, but
> I'm hoping python has already done it for me!

I wrote one that works on Windows and Unix. On Windows it understands
the AppPaths registration that can be done to make specific application
launchable without being on the PATH. It understands PATHEXT etc. It can
be used as a module or as a script.

    http://starship.python.net/~tmick/


Cheers,
Trent

-- 
Trent Mick
TrentM at ActiveState.com




More information about the Python-list mailing list