Windows微信清理工具,微信清理工具吾愛版本,論壇用戶通過Python語言編寫的一個自動清理工具,可以一鍵清理PC設(shè)備上的微信緩存文件,清理電腦內(nèi)存空間,經(jīng)常使用PC版微信的朋友們可以用這款軟件來清理積攢的垃圾數(shù)據(jù),讓你的電腦變得更加清潔。
微信清理工具說明
本工具采用Python編寫,先讀取“%userprofile%\AppData\Roaming\Tencent\WeChat\All Users\config\3ebffe94.ini”,確定WeChat Files文件夾的位置,進行掃描,列出所有登陸過的微信號,讓用戶選擇清理的對象,再列出菜單,通過if語句讓用戶來決定刪除哪些數(shù)據(jù),最后進行刪除操作。
程序要求輸入微信號只是為了定位文件夾位置,沒有對網(wǎng)絡(luò)進行連接的任何操作
微信清理工具功能
【1.清理聊天記錄】
【2.清理圖片和視頻】
【3..清理接收到的文件】
【4.清理全部數(shù)據(jù)】
源碼一覽
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.清理全部數(shù)據(jù)】-------------------------------
""")
while True:
choice = input("請輸入要執(zhí)行的操作所對應(yīng)的代碼:")
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("輸入錯誤,請重新輸入。")