【Python】Windows微信清理工具

本工具采用Python编写,先读取“%userprofile%\AppData\Roaming\Tencent\WeChat\All Users\config\3ebffe94.ini”,确定WeChat Files文件夹的位置,进行扫描,列出所有登陆过的微信号,让用户选择清理的对象,再列出菜单,通过if语句让用户来决定删除哪些数据,最后进行删除操作。

Python] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

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')

= open(r'C:' + users + '\\AppData\\Roaming\\Tencent\\WeChat\\All Users\\config\\3ebffe94.ini')

if == '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("输入错误,请重新输入。")

开源地址:https://github.com/yunlongzhuhuo/Windows-WeChat-Clean-Up-Tool

郑重声明:本程序要求输入微信号只是为了定位文件夹位置,没有对网络进行连接的任何操作,同时,我也不能访问你的任何聊天记录,因为它们都是加密的。本工具只是提供了一个便捷的渠道来删除文件,我对误删操作概不负责,请谨慎操作!
EXE成品本工具采用Python编写Windows微信清理工具.zip-互联网文档类资源-CSDN下载

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大飞哥软件自习室

希望支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值