On page 169 of the Programming ArcGIS 10.1 with Python cookbook.
Step 6 says to type this : for row in sorted(cursor):
But if you look at the number 04 which gave the error because PyScripter could not defined cursor ?
I have also type this 04 code into Python window and it showed it doesn't defined cursor is ....
import arcpy.da arcpy.env.workspace ="c:/ArcpyBook/Ch9" arcpy.da.SearchCursor("Schools.shp",("Facility","Name")) for row in in sorted(cursor): print("School name: " + row)