python之获取微信好友列表并保存文档中

代码以下微信

from wxpy import *
from pprint import pprint #登陆微信
bot = Bot() my_friend = bot.friends() f = open("friends.txt", 'w', encoding="utf-8")  # 建立friend文件,并将好友信息存进文档

#好友排序
for friend in my_friend: line = str(friend) + "\n" f.write(line)
相关文章
相关标签/搜索