基于 itchat 庫(kù)來(lái)獲取微信好友頭像并執(zhí)行拼接操作,對(duì)微信上文字化好友列表數(shù)據(jù)進(jìn)行可視化展示。
獲取好友頭像
def save_avatar(folder): """ 保存微信好友頭像 :param folder: 保存的文件夾 """ itchat.auto_login(hotReload=True) users = itchat.get_friends() or [] print('%d friends found.' % len(users)) if not os.path.exists(folder): os.makedirs(folder) index = 1 for i, user in enumerate(users): nickname = user.RemarkName username = user.UserName file_path = os.path.join(folder, '%03d_%s.png' % (i, nickname)) if not os.path.isfile(file_path): # 不重復(fù)下載 avatar = itchat.get_head_img(username) with open(file_path, 'w') as f: f.write(avatar) print('Download %d: %s' % (index, file_path)) index += 1
網(wǎng)頁(yè)名稱:Python拼接微信好友頭像大圖的實(shí)現(xiàn)方法-創(chuàng)新互聯(lián)
文章鏈接:http://vcdvsql.cn/article8/eioip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站改版、品牌網(wǎng)站制作、搜索引擎優(yōu)化、網(wǎng)頁(yè)設(shè)計(jì)公司、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容