parameters: (executable, path=None)
docstring: Tries to find 'executable' in the directories listed in 'path'.
  
      A string listing directories separated by 'os.pathsep'; defaults to
      os.environ['PATH'].  Returns the complete filename or None if not found.
docstring_summary: Tries to find 'executable' in the directories listed in 'path'.
docstring_tokens: Tries to find executable in the directories listed in path .
function: def find_executable(executable, path=None):
      """Tries to find 'executable' in the directories listed in 'path'.
  
      A string listing directories separated by 'os.pathsep'; defaults to
      os.environ['PATH'].  Returns the complete filename or None if not found.
      """
      if path is None:
          path = os.environ.get('PATH', os.defpath)
  
      paths = path.split(os.pathsep)
      base, ext = os.path.splitext(executable)
  
      if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
          executable = executable + '.exe'
  
      if not os.path.isfile(executable):
          for p in paths:
              f = os.path.join(p, executable)
              if os.path.isfile(f):
                  # the file exists, we have a shot at spawn working
                  return f
          return None
      else:
          return executable
function_tokens: def find_executable ( executable , path = None ) : if path is None : path = os . environ . get ( 'PATH' , os . defpath ) paths = path . split ( os . pathsep ) base , ext = os . path . splitext ( executable ) if ( sys . platform == 'win32' or os . name == 'os2' ) and ( ext != '.exe' ) : executable = executable + '.exe' if not os . path . isfile ( executable ) : for p in paths : f = os . path . join ( p , executable ) if os . path . isfile ( f ) : # the file exists, we have a shot at spawn working return f return None else : return executable