您好,登錄后才能下訂單哦!
小編給大家分享一下Python如何實現微信表情包炸群功能,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
Python實現微信表情包炸群效果,具體代碼如下所示;
# -*- coding = utf-8 -*- # @Time : 2021/1/26 15:19 # @Author : 陳良興 # @File : 微信表情包炸群.py # @Software : PyCharm # 運行程序 > 輸入次數 > 回車 > 打開微信對話框 > 將鼠標放置在“發送”按鈕處即可 from pynput.keyboard import Controller as KB #控制鍵盤輸入 from pynput.mouse import Controller,Button #控制鼠標點擊 import time import random Wechat_expression = [ "[微笑]","[撇嘴]","[色]","[發呆]","[得意]","[流淚]","[害羞]","[閉嘴]","[睡]","[大哭]","[尷尬]", "[發怒]","[調皮]","[呲牙]","[驚訝]","[難過]","[囧]","[抓狂]","[吐]","[偷笑]","[愉快]","[白眼]", "[傲慢]","[困]","[驚恐]","[憨笑]","[悠閑]","[咒罵]","[疑問]","[噓]","[暈]","[衰]","[骷髏]","[豬頭]", "[敲打]","[再見]","[擦汗]","[摳鼻]","[鼓掌]","[壞笑]","[右哼哼]","[鄙視]","[委屈]","[快哭了]", "[陰險]","[親親]","[可憐]","[笑臉]","[生病]","[臉紅]","[破涕為笑]","[恐懼]","[失望]","[無語]", "[嘿哈]","[捂臉]","[奸笑]","[機智]","[皺眉]","[耶]","[吃瓜]","[加油]","[汗]","[天啊]","[Emm]", "[社會社會]","[旺柴]","[好的]","[打臉]","[哇]","[翻白眼]","[666]","[讓我看看]","[嘆氣]","[苦澀]", "[裂開]","[嘴唇]","[愛心]","[心碎]","[擁抱]","[強]","[弱]","[握手]","[勝利]","[抱拳]","[勾引]", "[拳頭]","[OK]","[合十]","[啤酒]","[咖啡]","[蛋糕]","[玫瑰]","[凋謝]","[菜刀]","[便便]","[月亮]", "[太陽]","[禮物]","[紅包]","[發]","[福]","[跳跳]","[發抖]","[轉圈]","[炸彈]","[慶祝]","[煙花]" ] #鍵盤控制函數 def keyboardInput(string): keyboard = KB() keyboard.type(string) #鼠標控制函數 def mouseClick(): mouse = Controller() mouse.press(Button.left) mouse.release(Button.left) #響應函數 def response(number): time.sleep(5) #延遲5s響應 for i in range(number): sentence = random.choice(Wechat_expression) keyboardInput(sentence) mouseClick() time.sleep(0.4) #每條消息間隔0.4秒 if __name__ == "__main__": while True: print("\033[1;32m發動機已啟動,隨時可以出發!\033[0m") Num = input("\033[1;32m請輸入轟炸次數:\033[0m") if Num.isdigit(): response(int(Num)) print("\033[1;33m報告長官,轟炸完畢,請求下一步作戰計劃!!!\033[0m") else: print("\033[1;31m輸入錯誤,請重新輸入一個整數!!!\033[0m") #詢問是否繼續 answer = input("\033[1;34m是否執行下一次作戰計劃?(y 或者 n):\033[0m") if answer == "y": print("\033[1;33m繼續轟炸!!!\033[0m") continue if answer == "n": print("\033[1;33m停止轟炸,給他們喘口氣!!!\033[0m") break else: print("\033[1;31m輸入錯誤,請輸入“y”或者“n”!!!\033[0m")
操作如下:
首先,運行代碼,輸入次數。
然后,打開微信對話框,將鼠標放置在“發送”按鈕處,即可實現自動隨機發送表情包。
最后,根據自己的選擇是否繼續執行操作。
以上是“Python如何實現微信表情包炸群功能”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。