2

I need to look at all the fields in a joined table performed through arcpy. I am instigating

for fields in arcpy.Listfields(Feature):
  print fields

but it is returning a large list of:

<geoprocessing describe field object object at 0x0EBE4E60>
<geoprocessing describe field object object at 0x0EBE4D40>
<geoprocessing describe field object object at 0x0EBE4B18>
<geoprocessing describe field object object at 0x0EBE4758>
<geoprocessing describe field object object at 0x0EBE4E90>
<geoprocessing describe field object object at 0x0EBE4A28>
<geoprocessing describe field object object at 0x0EBE4428>

I have done this before but forget how its done.

4

Instead of:

for fields in arcpy.Listfields(Feature):
  print fields

try:

for field in arcpy.Listfields(Feature):
  print field.name

My changing of fields to field is not important but I think it makes the code read better. However, what is important is that ListFields returns a list of field objects and so you need to examine the name property of each to find that out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.