Python做一个微信QQ消息轰炸脚本,你有被别人轰炸过吗?
前言
本文的文字及图片来源于网络,仅供学习、交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理。
基本开发环境
- Python 3.6
- Pycharm
完整代码
1 from pynput.mouse import Button, Controller as mouse_Controller 2 from pynput.keyboard import Key, Controller as key_Controller 3 import time 4 import random 5 6 f = open("短句.txt", encoding="utf-8") 7 txt = f.read() 8 lis_text = txt.split(" ") 9 time.sleep(3) 10 11 mouse = mouse_Controller() # 控制鼠标 12 keyboard = key_Controller() 13 mouse.press(Button.left) # 按住鼠标左键 14 mouse.release(Button.left) # 松开鼠标左键 15 for i in range(99): 16 key_world = random.choice(lis_text) 17 time.sleep(1) 18 keyboard.type(key_world) 19 keyboard.press(Key.enter) 20 keyboard.release(Key.enter)