(filenames)
Find file on system path.
Find file on system path.
Find file on system path .
def search_on_path(filenames):
    """Find file on system path."""
    # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52224

    from os.path import exists, abspath
    from os import pathsep, environ

    search_path = environ["PATH"]

    paths = search_path.split(pathsep)
    for path in paths:
        for filename in filenames:
            if exists(join(path, filename)):
                return abspath(join(path, filename))
def search_on_path ( filenames ) : # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52224 from os . path import exists , abspath from os import pathsep , environ search_path = environ [ "PATH" ] paths = search_path . split ( pathsep ) for path in paths : for filename in filenames : if exists ( join ( path , filename ) ) : return abspath ( join ( path , filename ) )