forked from yunlongzhuhuo/Windows-WeChat-Clean-Up-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindows微信清理工具.py
65 lines (58 loc) · 2.06 KB
/
Windows微信清理工具.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
def delete(files):
os.system('del /f /s /q "%s\\*.*"' % files)
print("清理成功!")
users = os.path.expandvars('$HOMEPATH')
f = open(r'C:' + users + '\\AppData\\Roaming\\Tencent\\WeChat\\All Users\\config\\3ebffe94.ini')
if f == 'MyDocument:':
location = 'C:' + users + '\Documents\WeChat Files'
else:
location = f.read() + "\WeChat Files"
list = os.listdir(location)
list.remove('All Users')
list.remove('Applet')
print("""
""")
print(list)
print("""
""")
while True:
temp = input("选择你要清理的微信号:")
try:
if 0<int(temp)<=len(list):
temp1 = int(temp) - 1
wxid = list[temp1]
break
else:
print("输入错误,请重新输入。")
except:
print("输入错误,请重新输入。")
print("""
-----------------------------Windows微信清理工具-------------------------------------
------------------------------【1.清理聊天记录】---------------------------------
-----------------------------【2.清理图片和视频】-----------------------------------
-----------------------------【3.清理接收到的文件】------------------------------
------------------------------【4.清理全部数据】-------------------------------
""")
while True:
choice = input("请输入要执行的操作所对应的代码:")
if choice == '1':
dialog = location + "\\" + wxid + '\Msg'
delete(dialog)
break
elif choice == '2':
pictures = location + "\\" + wxid + '\FileStorage\Image'
delete(pictures)
videos = location + "\\" + wxid + '\FileStorage\Video'
delete(videos)
break
elif choice == '3':
documents = location + "\\" + wxid + '\FileStorage\File'
delete(documents)
break
elif choice == '4':
delall = location + "\\" + wxid
delete(delall)
break
else:
print("输入错误,请重新输入。")