We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7bf9c71 commit 343e0dbCopy full SHA for 343e0db
save-editor.py
@@ -189,6 +189,8 @@ def main():
189
operation_choice = input("Enter your choice: ")
190
191
if operation_choice == "1":
192
+ if os.path.exists(backup_file_path): # delete existing backup file if it exists
193
+ os.remove(backup_file_path)
194
with open(save_file_path, 'r') as original: data = original.read()
195
with open(backup_file_path, 'w') as backup: backup.write(data)
196
print("Backup created.")
0 commit comments