日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

python登录微信自动发送消息和绘画好友男女比例

發(fā)布時(shí)間:2025/4/16 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python登录微信自动发送消息和绘画好友男女比例 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

#coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )

import itchat

# itchat.login()
# itchat.send(u"您好",'filehelper')
#這樣你就可以保持一段時(shí)間登錄狀態(tài),而不用每次運(yùn)行代碼都要掃碼登錄了!
itchat.auto_login(hotReload=True)
itchat.dump_login_status()

?

itchat.send(u"您好",'filehelper') ?#給自己的文件傳輸助手發(fā)送消息

friends=itchat.get_friends(update=True)[:]
total=len(friends)-1
male=female=other=0

for friend in friends[1:]:
sex=friend["Sex"]
if sex==1:
male+=1
elif sex==2:
female+=1
else:
other+=1

from echarts import Echart,Legend,Pie
chart=Echart("%s的微信好友性別比例" %(friends[0])['NickName'],'from Wechat')
chart.use(Pie('WeChat',
[{'value': male, 'name': '男性 %.2f%%' % (float(male) / total * 100)},
{'value': female, 'name': '女性 %.2f%%' % (float(female) / total * 100)},
{'value': other, 'name': '其他 %.2f%%' % (float(other) / total * 100)}],
radius=["50%", "70%"]))

chart.use(Legend(["male", "female", "other"]))
del chart.json["xAxis"]
del chart.json["yAxis"]
chart.plot()

?

?

?

--------

運(yùn)行后會(huì)自動(dòng)彈出微信登錄二維碼,掃碼后登陸微信成功

轉(zhuǎn)載于:https://www.cnblogs.com/mias/p/7238138.html

總結(jié)

以上是生活随笔為你收集整理的python登录微信自动发送消息和绘画好友男女比例的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。