rajs.om

Read an attribute field of a shapefile

Discussion created by rajs.om on Apr 4, 2012
Latest reply on Apr 4, 2012 by dkwiens
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" '''

Outcomes