O'Reilly logo

Programming ArcGIS 10.1 with Python Cookbook by Eric Pimpler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting a list of fields in a feature class or table

Feature classes and tables contain one or more columns of attribute information. You can get a list of the fields in a feature class through the ListFields() function.

Getting ready

The ListFields() function returns a list containing individual Field objects for each field in a feature class or table. Some functions, such as ListFields() and ListIndexes(), require an input dataset to operate on. You can use a wildcard or field type to constrain the list that is returned. Each Field object contains various read-only properties, including Name, AliasName, Type, Length, and so on.

How to do it…

Follow these steps to learn how to return a list of fields in a feature class:

  1. Open IDLE and create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required