How do I find executable files from the environment PATH variable?

Trent Mick trentm at ActiveState.com
Tue Aug 6 13:59:39 EDT 2002


[Noah wrote]
> Basically I want to write "which" in Python.

Or you could just download it. :)

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

> Am I forced to check every directory in PATH 
> and test each one with os.access()? If so then
> will this script duplicate the actions of the
> shell in searching for an executable file?

Getting this right on Windows is a little bit of a pain.


Cheers,
Trent

-- 
Trent Mick
TrentM at ActiveState.com




More information about the Python-list mailing list