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)
相關文章
相關標籤/搜索