Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

Is there a quick way to see the fields in a table via arcpy?

$
0
0

I frequently find myself in Python debug mode, trying to examine the fields of a layer or table.

arcpy.Describe(lyr).fields returns an array of <geoprocessing describe field object> which isn’t much use.

About 10 times a day I find myself typing this:


flds = []
for fld in arcpy.Describe(lyr).fields:
flds.append(fld.name)

Is there a faster way to obtain a readable listing of the layer or table’s fields in arcpy?


Viewing all articles
Browse latest Browse all 767

Trending Articles