Skip to content

Commit 5cb8b49

Browse files
authored
第一个版本
文件去重小工具,暂时不支持文件夹
1 parent 7860d21 commit 5cb8b49

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

FileDistinctTool.exe

4.91 MB
Binary file not shown.

mmqm/Test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import os
2+
import shutil
3+
4+
print("FileDistinctTool version:0.0.1")
5+
6+
filePath = input("Please enter the folder you want to scan:")
7+
zus = os.listdir(filePath)
8+
sets = {}
9+
try:
10+
print("start")
11+
for i in zus:
12+
pathi = filePath + "\\" + i
13+
for j in zus:
14+
pathj = filePath + "\\" + j
15+
if j == i:
16+
continue
17+
if os.stat(pathi).st_size == os.stat(pathj).st_size:
18+
if sets.get(i) == None:
19+
if sets.get(j) == None:
20+
sets[i] = j
21+
k = sets.keys()
22+
v = sets.values()
23+
print("k:",k)
24+
print("v:",v)
25+
if len(sets) > 0:
26+
for i in sets:
27+
pathi = filePath + "\\" + i
28+
os.remove(pathi)
29+
print("end...")
30+
except Exception as e:
31+
print("error:",e)

mmqm/__pycache__/Test.cpython-37.pyc

774 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)