mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 12:46:15 +01:00
new diffybot
This commit is contained in:
parent
06252781a6
commit
5bc039ca51
1 changed files with 12 additions and 1 deletions
13
diffybot.py
13
diffybot.py
|
@ -49,4 +49,15 @@ result = [values for key, values in rev_dict.items()
|
||||||
if result:
|
if result:
|
||||||
print("Duplicate questions:", str(result))
|
print("Duplicate questions:", str(result))
|
||||||
else:
|
else:
|
||||||
print("There are no duplicates!")
|
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])
|
Loading…
Reference in a new issue