photo_field = "your_path_field" curs = arcpy.SearchCursor(fc,"","",photo_field) for row in curs: photo_path = row.getValue(photo_field) if os.path.exists(photo_path): print "%s exists" % os.path.basename(photo_path) else: print "%s not found" % os.path.basename(photo_path)
import arcpy import os featureClass = arcpy.GetParameterAsText(0) photo_field = "PhotoHotlink" results_field = "PhotoExists" curs = arcpy.UpdateCursor(featureClass, "", "", [photo_field, results_field]) #row = curs.next() for row in curs: photo_path = row.getValue(photo_field) if os.path.exists(photo_path): row.setValue(results_field, "Y") else: row.setValue(results_field, "N") curs.updateRow(row) #row = curs.next() del curs, row
import arcpy import os featureClass = arcpy.GetParameterAsText(0) photo_field = "PhotoHotlink" results_field = "PhotoExists" curs = arcpy.UpdateCursor(featureClass, results_field) row = curs.next() for row in curs: photo_path = row.getValue(photo_field) if os.path.exists(photo_path): row.setValue(results_field, "Y") else: row.setValue(results_field, "N") curs.updateRow(row) row = curs.next() del curs, row
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.