From 5bc039ca51185e4618cf43ff095849ddbe26e6f2 Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Tue, 22 Nov 2022 23:51:44 +0100 Subject: [PATCH] new diffybot --- diffybot.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/diffybot.py b/diffybot.py index b8d25c6..ff13352 100644 --- a/diffybot.py +++ b/diffybot.py @@ -49,4 +49,15 @@ result = [values for key, values in rev_dict.items() if result: print("Duplicate questions:", str(result)) else: - print("There are no duplicates!") \ No newline at end of file + print("There are no duplicates!") + exit() + +for dup in result: + #delete the duplicates + ld = list(dup) + for i in range(len(ld)): + if i == 0: + print("Keeping " + ld[i]) + continue + print("Deleting", ld[i]) + os.rmdir(path + "/" + ld[i]) \ No newline at end of file