Python equivalent to 'which'?

Michael Gilfix mgilfix at eecs.tufts.edu
Wed Jul 31 10:14:05 EDT 2002


On Tue, Jul 30 @ 10:36, Sean 'Shaleh' Perry wrote:
> I wrote that in about a minute and a half.

  Yes, and I could hack together a version in a minute as well. But
someone else couldn't. And it seems like a fairly common and useful
function. A full implementation is another story.

> Note it has a large assumption that PATH is defined and it is separated by
> colons.  This makes it only truly useful on a UNIX box.  of course 'which' is a
> UNIXism as well.  My point is, the python library is for the most part OS
> agnostic so I do not see this fitting in too well.

  I didn't mean for the function to go in as is. I meant the general functionality.
Perhaps the starship version in the other thread is the best solution.

                          -- Mike

-- 
Michael Gilfix
mgilfix at eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html




More information about the Python-list mailing list