Read an attribute field of a shapefile

4607
1
04-04-2012 10:35 AM
RaviSadasivuni1
New Contributor
I am a novice in python. Please help me.
I want to read an attribute field of a shapefile and print its attribute value in python.
The attribute is 'ATTRACTIVE'.

#My code:
# Import system modules
import sys, string, os, arcgisscripting
import arcpy
from arcpy import env
from arcpy.sa import *
# Create the Geoprocessor object
gp = arcgisscripting.create()


# Set current workspace
env.workspace = "H:\\desktop\\test"

# Read the attractive attribute
fieldList = arcpy.ListFields("H:\\desktop\\test\\testing0.shp")

'''for field in fieldList:
    field.name = "ATTRACTIVE" '''
Tags (2)
0 Kudos
1 Reply
DarrenWiens2
MVP Honored Contributor
See the example for how to use a SearchCursor.
0 Kudos