On Friday, 21 September 2012 02:37:01 UTC+5:30, gelonida wrote: > I'd like to implement the equivalent functionality of the unix command > > /usr/bin/which > > > > The function should work under Linux and under windows. > > > > Did anybody already implement such a function. > > If not, is there a portable way of splitting the environment variable PATH? > > > > Thanks for any sugestions
shutil.which does this in Python 3.3: http://docs.python.org/dev/library/shutil.html#shutil.which You can copy the code to support older Python versions. -- http://mail.python.org/mailman/listinfo/python-list