def _find_script(script_name):
 if os.path.isfile(script_name):
  return script_name
 path = os.getenv('PATH', os.defpath).split(os.pathsep)
 for folder in path:
  if (folder == ''):
   continue
  fn = os.path.join(folder, script_name)
  if os.path.isfile(fn):
   return fn
 sys.stderr.write('Could not find script {0}\n'.format(script_name))
 raise SystemExit(1)

def _find_script ( script_name ) : if os . path . isfile ( script_name ) : return script_name path = os . getenv ( 'PATH' , os . defpath ) . split ( os . pathsep ) for folder in path : if ( folder == '' ) : continue fn = os . path . join ( folder , script_name ) if os . path . isfile ( fn ) : return fn sys . stderr . write ( 'Could not find script {0}\n' . format ( script_name ) ) raise SystemExit ( 1 )
find the script .