def is_program_installed(basename):
 for path in os.environ['PATH'].split(os.pathsep):
  abspath = osp.join(path, basename)
  if osp.isfile(abspath):
   return abspath

def is_program_installed ( basename ) : for path in os . environ [ 'PATH' ] . split ( os . pathsep ) : abspath = osp . join ( path , basename ) if osp . isfile ( abspath ) : return abspath
return program absolute path if installed in path .