#coding=utf-8
#基於python3.6
import itchat,time
import sys
from itchat.content import *
itchat.auto_login()
wish_list = ['湯圓說:我不開口就是為了讓你永遠在我心中。水說:我時時刻刻流淌不息就是為了永遠把你擁抱。'
'鍋說:都快熟了還貧呢。值此元宵佳節之際,***祝您工作順利,萬事如意,闔家歡樂!']
sincere_wish = wish_list[0]
friendlist = itchat.get_friends(update=true)[1:]
for g in range(0,len(friendlist)):
itchat.send(sincere_wish,friendlist[g]['username'])
print((friendlist[g]['remarkname'] or friendlist[g]['nickname']),'已傳送')
sys.stdout.write(str(g+1)+"/"+str(len(friendlist))+"\r")
sys.stdout.flush()
time.sleep(2)
print('done')
執行效果如下:
通過itchat進行給好友傳送訊息
通過itchat模組,給指定的使用者傳送訊息,使用的開發環境是ubuntu16.04lts python2.7 sudo pip install itchat安裝itchat,下面就可以愉快的玩耍了。name itchat.search friends name u 小明 xiaoming name...
itchat 監控微信好友撤回訊息
coding utf 8 import itchat from itchat.content import text from itchat.content import import sys import time import re import importlib import os impo...
基於itchat和pil獲取微信好友頭像並進行拼接
user friends username image itchat.get head img user import itcht itchat.auto login hotreload true friends itchat.get friends for friends in friends u...