這期內容當中小編將會給大家帶來有關使用Python怎么查看微信撤回消息,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
1、簡單易用,與C/C++、Java、C# 等傳統語言相比,Python對代碼格式的要求沒有那么嚴格;2、Python屬于開源的,所有人都可以看到源代碼,并且可以被移植在許多平臺上使用;3、Python面向對象,能夠支持面向過程編程,也支持面向對象編程;4、Python是一種解釋性語言,Python寫的程序不需要編譯成二進制代碼,可以直接從源代碼運行程序;5、Python功能強大,擁有的模塊眾多,基本能夠實現所有的常見功能。
Python查看微信撤回消息源代碼:
mport re
import time
import itchat
from itchat.content import *
@itchat.msg_register([TEXT, PICTURE, MAP, CARD, NOTE, SHARING, RECORDING, ATTACHMENT, VIDEO])
def text_reply(msg):
print(msg['Text'])
@itchat.msg_register([TEXT, PICTURE, MAP, CARD, NOTE, SHARING, RECORDING, ATTACHMENT, VIDEO])
@itchat.msg_register([TEXT, PICTURE, MAP, CARD, NOTE, SHARING, RECORDING, ATTACHMENT, VIDEO])
def text_reply(msg):
if msg['Type'] == 'Text':
reply_content = msg['Text']
elif msg['Type'] == 'Picture':
reply_content = r"圖片: " + msg['FileName']
elif msg['Type'] == 'Card':
reply_content = r" " + msg['RecommendInfo']['NickName'] + r" 的名片"
elif msg['Type'] == 'Map':
x, y, location = re.search("<location x=\"(.*?)\" y=\"(.*?)\".*label=\"(.*?)\".*", msg['OriContent']).group(1,
2,
3)
if location is None:
reply_content = r"位置: 緯度->" + x.__str__() + " 經度->" + y.__str__()
else:
reply_content = r"位置: " + location
elif msg['Type'] == 'Note':
reply_content = r"通知"
elif msg['Type'] == 'Sharing':
reply_content = r"分享"
elif msg['Type'] == 'Recording':
reply_content = r"語音"
elif msg['Type'] == 'Attachment':
reply_content = r"文件: " + msg['FileName']
elif msg['Type'] == 'Video':
reply_content = r"視頻: " + msg['FileName']
else:
reply_content = r"消息"
friend = itchat.search_friends(userName=msg['FromUserName'])
itchat.send(r"Friend:%s -- %s "
r"Time:%s "
r" Message:%s" % (friend['NickName'], friend['RemarkName'], time.ctime(), reply_content),
toUserName='filehelper')
itchat.send(r"我已經收到你在【%s】發送的消息【%s】稍后回復。--微信助手(Python版)" % (time.ctime(), reply_content),
toUserName=msg['FromUserName'])
itchat.auto_login()
itchat.run()上述就是小編為大家分享的使用Python怎么查看微信撤回消息了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。