Saturday 20 May 2017

arcgis 10.1 - Why does arcpy.da.SearchCursor() class not autocomplete within Eclipse?


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.


enter image description here


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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...