-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (22 loc) · 870 Bytes
/
Copy pathmain.py
File metadata and controls
32 lines (22 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from finder import get_all_files, find_duplicates, remove_file
def main():
folder_path = input("Enter your file path: ")
files = get_all_files(folder_path)
print ("\nScanning for duplicates...\n")
duplicates = find_duplicates(files)
if not duplicates:
print("No duplicated files found")
else:
print("Duplicated files")
for file_hash, file_list in duplicates.items():
print("---------")
for file in file_list:
print(file)
delete_choice = input("Do you want to delete the duplicate files? (y/n):")
if delete_choice.lower() == 'y':
for file_hash, file_list in duplicates.items():
for file in file_list:
remove_file(file)
print("End")
if __name__ == "__main__":
main()