#获得唯一值 by gisoracle def getuniqueValue(inTable,inField): rows = arcpy.da.SearchCursor(inTable,[inField]) # Create an empty list uniqueList = [] try: for row in rows: v=row[0] # If the value is not already in the list, append it if v not in uniqueList: uniqueList.append(v) return uniqueList finally: if rows: del rows