Do you check if the file already exists before calling the delete function check like below import os if os.exists(Full path of the text file"): os.delete(Full path of the text file)
import os draftFileName = r'd:\temp\draft.txt' draftFile = open(draftFileName, 'w') #do stuff draftFile.close() if os.path.exists(draftFileName): os.remove(draftFileName)
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.