(file, env=os.environ)
return None
Tries to find the exact path for a given filename.

    Returns None if no file was found.
Tries to find the exact path for a given filename.
Tries to find the exact path for a given filename .
def which(file, env=os.environ):
    """Tries to find the exact path for a given filename.

    Returns None if no file was found.
    """
    if file is None:
        return None
    for path in env.get('PATH', '').split(os.pathsep):
        if path:
            result = os.path.join(path, file)
            if os.path.exists(result):
                return os.path.realpath(result)
    return None
def which ( file , env = os . environ ) : if file is None : return None for path in env . get ( 'PATH' , '' ) . split ( os . pathsep ) : if path : result = os . path . join ( path , file ) if os . path . exists ( result ) : return os . path . realpath ( result ) return None