LarryAdgate

set and arcpy.da.Search Cursor

Discussion created by LarryAdgate on Nov 12, 2013
Latest reply on Nov 12, 2013 by xander_bakker
Except for the #local Variables, the body of this script works fine. When working with one feature class, setting a workspace seems easy, but when setting the workspace for multiple feature classes it becomes more difficult. If anyone can help-a world of thanks, Larry   

import arcpy
import sets

#local Variables:
Asbuilt_Log = "C:/Projects/Asbuilt_Log.gdb"
Rancho = "C:/Projects/North/Rancho.gdb"
Clearlake = "C:/Projects/South/Clearlake.gdb

#Body of script
set_one = set, int(r[0] for r in arcpy.da.SearchCursor("Asbuilt_Log", "GWO"))
set_two = set, int(r[0] for r in arcpy.da.SearchCursor("Rancho", "GWO"))
set_three = set, int(r[0] for r in arcpy.da.SearchCursor("Clearlake", "GWO"))                                                      
print "Items unique to Asbuilt_Log: {}".format(", ".join(sorted(set_one-set_two-set_three)))

Outcomes