代碼以下微信
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)