Python 微信
代码:
import itchat itchat.login() friends = itchat.get_friends(update=True)[0:]
显示:
friends
好友分类:
male = female = others =0
for i in friends[1:]:
sex = i["Sex"]
if sex ==1:
male +=1
elif sex ==2:
female +=1
else:
others +=1
total = len(friends[1:])
print("男生:",male)
print("女生:",female)
print("未知:",others)
男生: 353 女生: 141 未知: 39
公众号请关注:侠之大者

浙公网安备 33010602011771号