From f79cba46d061ec0241fffb3874ffa02b2f77dc24 Mon Sep 17 00:00:00 2001 From: cevoj35548 Date: Mon, 5 Jun 2023 20:03:39 -0500 Subject: [PATCH] Overwrite existing filename in csv export --- FmhyChecker.pyw | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FmhyChecker.pyw b/FmhyChecker.pyw index 689f881..14e1bd8 100644 --- a/FmhyChecker.pyw +++ b/FmhyChecker.pyw @@ -276,6 +276,9 @@ class UI(QMainWindow): if not file_dialog.exec_(): return file_path = file_dialog.selectedFiles()[0] + # remove file if it already exists + if os.path.exists(file_path): + os.remove(file_path) links = self.searchText(self.inputBox.toPlainText()) try: with open(file_path, 'w', newline='') as csvfile: