result = int(arcpy.GetCount_management(Variable1).getOutput(0))
del addRow
Does the empty table have the fields you are trying to populate?
Result is not an integer you can compare how you are. You need this.result = int(arcpy.GetCount_management(Variable1).getOutput(0))Also don't forget to add this at the end of your script.del addRow
type(variable) repr(variable)
>>> result = arcpy.GetCount_management(fc) >>> type(result) <class 'arcpy.arcobjects.arcobjects.Result'> >>> repr(result) "<Result '60'>"
>>> result = arcpy.GetCount_management(fc).getOutput(0) >>> type(result) <type 'unicode'> >>> repr(result) "u'60'"
>>> result = int(arcpy.GetCount_management(fc).getOutput(0)) >>> type(result) <type 'int'> >>> repr(result) '60'
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.