tags:

views:

458

answers:

1

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 sFields[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

+1  A: 

try this:

sFields = gp.ListFields(linktofeatureclass)
for field in sFields:
    print field.Name, field.Type, field.Scale

For more information, consult with the docs.

SilentGhost
Thanks for the great answer and the pointer to the docs - much appreciated.
Tom