def find_program(basename):
 names = [basename]
 if (os.name == 'nt'):
  extensions = ('.exe', '.bat', '.cmd')
  if (not basename.endswith(extensions)):
   names = ([(basename + ext) for ext in extensions] + [basename])
 for name in names:
  path = is_program_installed(name)
  if path:
   return path

def find_program ( basename ) : names = [ basename ] if ( os . name == 'nt' ) : extensions = ( '.exe' , '.bat' , '.cmd' ) if ( not basename . endswith ( extensions ) ) : names = ( [ ( basename + ext ) for ext in extensions ] + [ basename ] ) for name in names : path = is_program_installed ( name ) if path : return path
find program in path and return absolute path try adding .