<> one , use Python Automatically send wechat messages
import itchat # enableCmdQR=True, Allow in cmd Command line display QR code # hotReload=True, Allow short-term can not need to repeat login
itchat.auto_login(enableCmdQR=True,hotReload=True) # to_name =
itchat.search_friends(name=" Wechat friends note name ") # print(to_name) # # Send text message # for i in
range(10): # itchat.send(' Under test ...',toUserName=to_name[0]['UserName']) # # # Send expression pack
# file_img = 'biaoqingbao.jpg' #
itchat.send_image(file_img,toUserName=to_name[0]['UserName']) #
search_chatrooms Get group chat list in address book update=True Will get real-time information of the group # myroom =
itchat.get_chatrooms(update=True) # print(myroom) to_room = itchat.
search_chatrooms(name=' Group chat name ') # print(to_room) for i in range(10): itchat.send(
' Text message to be sent ',toUserName=to_room[0]['UserName'])
<> two , use Python Automatic reception and Reply to wechat message , At the same time, the received files are saved automatically
from itchat.content import * # Determine the type of information received , If the message received is text , Then execute the following function @itchat.
msg_register(TEXT) def text_reply(msg): print(msg.text) reply_text = msg.text.
replace(' Is that right ?','!') # print(reply_text) return reply_text #
@itchat.msg_register([PICTURE,RECORDING,ATTACHMENT,VIDEO]) # def
download_files(msg): # print(msg) # msg.download(msg.fileName) itchat.auto_login
(enableCmdQR=True,hotReload=True) # Make sure the program is running all the time itchat.run()
<> three , After the file is modified, the modified information is sent to the designated wechat friends in real time
import os import time import xlrd import itchat itchat.auto_login(enableCmdQR=
True,hotReload=True) change_time_save = time.ctime(os.stat('aaa.xlsx').st_mtime)
while True: time.sleep(5) change_time = time.ctime(os.stat('aaa.xlsx').st_mtime)
if change_time_save == change_time: pass else: change_time_save = change_time
xlsx= xlrd.open_workbook('aaa.xlsx') table = xlsx.sheet_by_index(0) content =
str(table.cell_value(0,0)) to_name = itchat.search_friends(name=' Note name of wechat friends ')
itchat.send(content,toUserName=to_name[0]['UserName']) print(" Sent successfully ! time :" + time.
strftime("%Y-%m-%d %H:%M:%S",time.localtime()))

©2019-2020 Toolsou All rights reserved,
Final review of database : Summary of comprehensive application questions use Python Make simple games Laplance operator ( Second derivative ) Convert hard disk to GPT Partition format Python Implementation of Hanoi Tower code about String How to create objects vue3 Learning journey 1—— establish vue3 project java String from back to front _Java String String summary use Python Write a story about plants versus zombies 【 Greedy Algorithm 】 Huffman coding problem