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