parameters: (script_name)
docstring: Find the script.
  
      If the input is not a file, then $PATH will be searched.
docstring_summary: Find the script.
docstring_tokens: Find the script .
function: def find_script(script_name):
      """Find the script.
  
      If the input is not a file, then $PATH will be searched.
      """
      if os.path.isfile(script_name):
          return script_name
      path = os.getenv("PATH", os.defpath).split(os.pathsep)
      for dir in path:
          if dir == "":
              continue
          fn = os.path.join(dir, script_name)
          if os.path.isfile(fn):
              return fn
  
      sys.stderr.write("Could not find script %s\n" % script_name)
      raise SystemExit(1)
function_tokens: def find_script ( script_name ) : if os . path . isfile ( script_name ) : return script_name path = os . getenv ( "PATH" , os . defpath ) . split ( os . pathsep ) for dir in path : if dir == "" : continue fn = os . path . join ( dir , script_name ) if os . path . isfile ( fn ) : return fn sys . stderr . write ( "Could not find script %s\n" % script_name ) raise SystemExit ( 1 )