日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

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

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

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

import itchat

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

?

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

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()

?

?

?

--------

運行后會自動彈出微信登錄二維碼,掃碼后登陸微信成功

轉載于:https://www.cnblogs.com/mias/p/7238138.html

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。