Friday, 11 March 2016

python - Deleting the cursor object


Can someone explain why you need to delete the cursor objects and the iterator when you use for example:



arcpy.UpdateCursor(blah)

I've checked the esri docs and there doesn't seem to be an explanation there, but the object is shown to be deleted at the end of both example scripts.



Answer



You need to delete the object in order to release any locks the UpdateCursor has taken out.


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...