FieldNames = [f.Name for f in arcpy.ListFields(tbl)] # field name strings in a list Rows = arcpy.UpdateCursor(tbl) for Row in Rows: for f in FieldNames: print f, str(Row.GetValue(f))
Alternatively, the ListFields and ListIndexes functions can be used to create the same lists.
FieldObjects = arcpy.Describe(tbl).Fields FieldNames = [f.Name for f in FieldObjects] # field name strings in a list Rows = arcpy.UpdateCursor(tbl) for Row in Rows: for f in FieldNames: print f, str(Row.GetValue(f)) print
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.