一、环境配置和安装

一、环境配置

环境版本
Python3.9、3.10、3.11、3.12
OSWindows10、11, Windows Server2016、2019、2022
微信3.9.12

二、安装

TIP

1. 开源版

pip install wxauto

2. ✨Plus版

pip install wxautox

# 或指定python版本安装:
py -3.12 -m pip install wxautox
WARNING

注意仅支持 Python3.9 至 3.12

激活:

wxautox -a 激活码

wxauto_auth

三、测试运行

from wxauto import WeChat   # 开源版
# from wxautox import WeChat   # ✨Plus版

# 初始化微信实例
wx = WeChat()

# 发送消息
wx.SendMsg("你好", who="文件传输助手")

# 获取当前聊天窗口消息
msgs = wx.GetAllMessage()

for msg in msgs:
    print('==' * 30)
    print(f"{msg.sender}: {msg.content}")
TIP

Success