I am very new to GIS.
I just installed eclipse luna with pydev plug-in and ArcGIS 10.1 for Desktop.
When I write a script, trying to import arcpy.da.SearchCursor I see that no SearchCursor is available to autocomplete.

What is the problem? What I did wrong?
Answer
SearchCursor is a class in the arcpy.da module and not a module itself, so if you wanted to import just that class you could use:
from arcpy.da import SearchCursor
You could then reference it as just SearchCursor.
You can also import the entire module and reference the class within, and it's also worth noting that import arcpy automatically imports arcpy.da and a bunch of other arcpy related things.
No comments:
Post a Comment