This code works in the arcgis python window but in PyScripter, this warning message had been written:
Traceback (most recent call last): File "", line 16, in File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy_init_.py", line 1167, in SearchCursor return gp.searchCursor(dataset, where_clause, spatial_reference, fields, sort_fields) File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing_base.py", line 359, in searchCursor self._gp.SearchCursor(*gp_fixargs(args, True))) IOError:
import arcpy
arcpy.env.workspace = r"C:\Desktop\spatial statistics analysis tutorials\PatternAnalysis\PatternAnalysisExercise\DengueData.gdb"
# place all the rows from the feature class into a search cursor
cursor = arcpy.SearchCursor("IndCases")
# iterate through the cursor and print the attributes to the interactive window
# print it in a standard three line format
for row in cur:
print row.AGE
I was wondering why this situation happened, any suggestions?
for row in cursor
since that's the name you've given to the cursor a few lines earlier