<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read an attribute field of a shapefile in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/read-an-attribute-field-of-a-shapefile/m-p/587519#M46066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See the example for how to use a &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=SearchCursor_method"&gt;SearchCursor&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Apr 2012 17:41:43 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2012-04-04T17:41:43Z</dc:date>
    <item>
      <title>Read an attribute field of a shapefile</title>
      <link>https://community.esri.com/t5/python-questions/read-an-attribute-field-of-a-shapefile/m-p/587518#M46065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a novice in python. Please help me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to read an attribute field of a shapefile and print its attribute value in python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The attribute is 'ATTRACTIVE'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import system modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import sys, string, os, arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy.sa import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create the Geoprocessor object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set current workspace &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "H:\\desktop\\test"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Read the attractive attribute&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fieldList = arcpy.ListFields("H:\\desktop\\test\\testing0.shp")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'''for field in fieldList:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; field.name = "ATTRACTIVE" '''&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 17:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/read-an-attribute-field-of-a-shapefile/m-p/587518#M46065</guid>
      <dc:creator>RaviSadasivuni1</dc:creator>
      <dc:date>2012-04-04T17:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read an attribute field of a shapefile</title>
      <link>https://community.esri.com/t5/python-questions/read-an-attribute-field-of-a-shapefile/m-p/587519#M46066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See the example for how to use a &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=SearchCursor_method"&gt;SearchCursor&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 17:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/read-an-attribute-field-of-a-shapefile/m-p/587519#M46066</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-04-04T17:41:43Z</dc:date>
    </item>
  </channel>
</rss>

