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[1])
Solved! Go to Solution.
In any case, this is how I usually see and use da cursors:
>>> with arcpy.da.SearchCursor("YOUR_LAYER_HERE",("ID","FID")) as cursor: ... for row in sorted(cursor): ... print row
You have two "in"s: "for row in in sorted(cursor):"
In any case, this is how I usually see and use da cursors:
>>> with arcpy.da.SearchCursor("YOUR_LAYER_HERE",("ID","FID")) as cursor: ... for row in sorted(cursor): ... print row
Yes that worked !
Let's check out some ways to fix this problem.
Double-Check Your Hardware.
Double-Check Your Mouse's Surface.
Change Touchpad Settings.
Disconnect Other Devices.
Run the Hardware Troubleshooter.
Update Your Mouse's Drivers.
Tame Your Mouse.
Regards,
Rachel Gomez
Thank you however, this post was dated back in 2015. Hopefully others can test theirs.
@RachelGomez , the original question had to do with ArcPy cursors and not computer mouse cursors, so checking hardware and mouse and trackpad settings would have no effect.