Ai
1 Star 0 Fork 0

johnforrest/pythonoffice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
27.getfwechatfriendsphoto.py 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
johnforrest 提交于 2022-03-22 21:53 +08:00 . Initial commit
# coding=utf-8
# pip install -U wxpy
from wxpy import *
import os,sys
# https://blog.csdn.net/hellokandy/article/details/90665129
# 初始化机器人,扫码登陆微信-Windows系统
# #初始化执行登陆操作,需要手机扫描登陆
# 初始化机器人,扫码登陆微信-Windows系统
# #初始化执行登陆操作,需要手机扫描登陆
# (1)极简模式:robot = Bot()
# (2)终端模式:robot = Bot(console_qr=True)
# (3)缓存模式(可保持登录状态):robot = Bot(cache_path=True)
# bot = Bot()
bot = Bot(cache_path=True)
# bot = Bot(console_qr=True)
# linux系统,执行登陆请调用下面语句
# bot=Bot(console_qr=2,cache_path="botto.pkl")
# 获取当前路径信息
image_dir=os.getcwd()+"\\"+'FriendImgs\\'
# 如果保存头像的 FriendImgs 目录不存在就创建一个
if not os.path.exists(image_dir):
os.makedirs(image_dir)
os.popen('explorer '+image_dir)
my_friends=bot.friends(updata=True)
# 获取好友头像并存储到 FriendImgs 目录中
n=0
for friend in my_friends:
print(friend)
image_name=image_dir+str(n)+'.jpg'
friend.get_avatar(image_name)
n=n+1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/johnforrest/pythonoffice.git
git@gitee.com:johnforrest/pythonoffice.git
johnforrest
pythonoffice
pythonoffice
master

搜索帮助