Hi! When programming I often use temporary Layers. E.g. "Make Feature Layer (Data Management)". Normally I delete those files at the end of my loop. But when i am still writing the code and test it, python often interrupts because it discovers whatever mistake. My problem is that now I have all this temporary layers that are blocked?/not deleted?. So next time i rund my code it states that the temporary layer does already exist. Is there any way to delete all this temp layers when the code is interrupted? or a way to creat unique layers/files/whatever everytime i run the code?
Deleting layers never worked for me, maybe it does now in 10. My solution is to set gp.overwriteoutput = True or arcpy.env.overwriteOutput = True Then you can always overwrite an in-memory layer definition.