ArcGIS: accessing python list output from listFields geoprocessor
I'm trying to access the output from the listFields
geoprocessing object using the following code:
sFields = gp.ListFields(linktofeatureclass)
for j in range(len(sFields)):
print sFiel开发者_Go百科ds[j]
How do I get information about the fields that I have enumerated? Printing them (i.e. sFields
in the above) just returns "geoprocessing describe field object object at 0x00E42E18". I'm looking for the field name, type, length, etc.
Thanks
try this:
sFields = gp.ListFields(linktofeatureclass)
for field in sFields:
print field.Name, field.Type, field.Scale
For more information, consult with the docs.
精彩评论