def find_in_path(name, path):
 for dir in path.split(os.pathsep):
  binpath = pjoin(dir, name)
  if os.path.exists(binpath):
   return os.path.abspath(binpath)
 return None

def find_in_path ( name , path ) : for dir in path . split ( os . pathsep ) : binpath = pjoin ( dir , name ) if os . path . exists ( binpath ) : return os . path . abspath ( binpath ) return None
find a file in a search path .