python library call equivalent to `which' command

Trent Mick trentm at activestate.com
Mon Jun 29 23:45:44 CEST 2009


destroooooy wrote:
> Hi,
>   I'm looking for a Python library function that provides the same
> functionality as the `which' command--namely, search the $PATH
> variable for a given string and see if it exists anywhere within. I
> currently examine the output from `which' itself, but I would like
> something more portable. I looked through the `os' and `os.path'
> modules but I didn't find anything.

http://code.google.com/p/which/


Trent

-- 
Trent Mick
trentm at activestate.com
http://trentm.com/blog/



More information about the Python-list mailing list