wxpy微信应用

时间:2018-06-25 13:05:54   收藏:0   阅读:188

 

技术分享图片
import wxpy
bot = wxpy.Bot(console_qr=-1, cache_path=True)

my_friends = bot.friends()
male = 0
female = 0
other = 0
for friend in my_friends:
    if friend.sex == 1:
        male += 1
    elif friend.sex == 2:
        female += 1
    else:
        other += 1       
print("male = ", male)
print("female = ", female)
print("total numbers = ", len(my_friends))
好友性别统计

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!