def require_tool(tool_name):
 path = os.environ.get('PATH')
 if (not path):
  return False
 for searchdir in path.split(os.pathsep):
  executable1 = os.path.normpath(os.path.join(searchdir, tool_name))
  executables = [executable1]
  if sys.platform.startswith('win'):
   executables.append((executable1 + '.exe'))
  for executable in executables:
   if os.path.isfile(executable):
    return True
 return False

def require_tool ( tool_name ) : path = os . environ . get ( 'PATH' ) if ( not path ) : return False for searchdir in path . split ( os . pathsep ) : executable1 = os . path . normpath ( os . path . join ( searchdir , tool_name ) ) executables = [ executable1 ] if sys . platform . startswith ( 'win' ) : executables . append ( ( executable1 + '.exe' ) ) for executable in executables : if os . path . isfile ( executable ) : return True return False
check if a tool is provided on this platform .