python用updatecursor删除行

arcpy.env.workspace = “C:/ArcpyBook/Ch8/WildfireData/WildlandFires.mdb”

try:

…   with arcpy.da.UpdateCursor(“FireIncidents”,(“CONFID_RATING”),'[CONFID_RATING] =  \’1\”) as cursor:

…      cntr = 1

…      for row in cursor:

…        cursor.deleteRow()

…        print(“Record number ” + str(cntr) + ” deleted”)

…        cntr = cntr + 1

except Exception as e:

…     print(e.message)

转载自:https://blog.csdn.net/sinat_25006091/article/details/82944060

You may also like...