Skip to main content
added 1 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

My two minutequick test below shows that the answer to your question is "No".

>>> for x in arcpy.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads"):
...     print x[0]
...     
Runtime error 
Traceback (most recent call last):
  File "<string>", line 2, in <module>
TypeError: 'Row' object does not support indexing

However, if you are using ArcGIS for Desktop 10.1 or 10.2 then arcpy.da.SearchCursor provides the functionality that you seek.

>>> for x in arcpy.da.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads","*"):
...     print x[0]
...     
172
173
174
175

My two minute test shows that the answer to your question is "No".

>>> for x in arcpy.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads"):
...     print x[0]
...     
Runtime error 
Traceback (most recent call last):
  File "<string>", line 2, in <module>
TypeError: 'Row' object does not support indexing

However, if you are using ArcGIS for Desktop 10.1 or 10.2 then arcpy.da.SearchCursor provides the functionality that you seek.

>>> for x in arcpy.da.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads","*"):
...     print x[0]
...     
172
173
174
175

My quick test below shows that the answer to your question is "No".

>>> for x in arcpy.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads"):
...     print x[0]
...     
Runtime error 
Traceback (most recent call last):
  File "<string>", line 2, in <module>
TypeError: 'Row' object does not support indexing

However, if you are using ArcGIS for Desktop 10.1 or 10.2 then arcpy.da.SearchCursor provides the functionality that you seek.

>>> for x in arcpy.da.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads","*"):
...     print x[0]
...     
172
173
174
175
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

My two minute test shows that the answer to your question is "No".

>>> for x in arcpy.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads"):
...     print x[0]
...     
Runtime error 
Traceback (most recent call last):
  File "<string>", line 2, in <module>
TypeError: 'Row' object does not support indexing

However, if you are using ArcGIS for Desktop 10.1 or 10.2 then arcpy.da.SearchCursor provides the functionality that you seek.

>>> for x in arcpy.da.SearchCursor(r"C:\polygeo\ArcTutor\Editing\Zion.gdb\Roads","*"):
...     print x[0]
...     
172
173
174
175