def IsOnPythonPath(path):
 for syspath in sys.path:
  try:
   if (syspath and (win32ui.FullPath(syspath) == path)):
    return 1
  except win32ui.error as details:
   print ("Warning: The sys.path entry '%s' is invalid\n%s" % (syspath, details))
 return 0

def IsOnPythonPath ( path ) : for syspath in sys . path : try : if ( syspath and ( win32ui . FullPath ( syspath ) == path ) ) : return 1 except win32ui . error as details : print ( "Warning: The sys.path entry '%s' is invalid\n%s" % ( syspath , details ) ) return 0
given a path only .