此代码的目的就是让好友拉黑或者删除你!谨慎使用!python
说明git
站在巨人的肩膀上github
基于python,这个小程序是用python写的小程序
使用的是python第三方库itchat,itchat模块是一位叫littlecodersh的大神写的模块,附上大神的github地址,有兴趣的朋友能够去尝试玩一下itchat模块,颇有趣的!!!https://github.com/littlecode...微信
准备cookie
Python3.6 须要安装python3.6并配置好环境路径code
安装好python后,打开电脑的CMD终端输入pip install itchat安装itchat模块ip
须要设置好默认看图软件rem
核心代码get
import itchatimport timeprint('扫一下弹出来的二维码') itchat.auto_login(hotReload=True) boom_remark_name = input('输入你要轰炸的人的微信备注,按回车建继续') message = input('输入你要轰炸的内容,按回车键开始轰炸') boom_obj = itchat.search_friends(remarkName=boom_remark_name)[0]['UserName']while True: time.sleep(0.5) print('正在轰炸。。。') itchat.send_msg(msg=message, toUserName=boom_obj)
代码讲解
import itchat
导入itchat模块
import time
导入time模块
itchat.auto_login(hotReload=True)
登陆微信,采用热加载的方式登陆网页版的微信,会生成一个itchat.pkl的文件,用于保持登陆状态,有点相似于cookie
boom_remark_name = input('输入你要轰炸的人的微信备注,按回车建继续')
这里必定要输入你给微信好友的备注名
,否者没法定位到好友
message = input('输入你要轰炸的内容,按回车键开始轰炸')
这里输入要轰炸的内容
boom_obj = itchat.search_friends(remarkName=boom_remarkname)[0]['UserName']
这里经过微信好友的备注名
找到微信好友的信息,再经过UserName
定位到好友
while True:
死循环轰炸 time.sleep(0.5)
设置睡眠,以避免出现消息发送频繁致使不能发送微信消息,此处可自行设置,睡眠时间不能过短 print('正在轰炸。。。')
itchat.send_msg(msg=message, toUserName=boom_obj)
如何使用
打开CMD终端
输入python
将We.py文件拖入终端
按回车
扫一下弹出来的二维码,确认登陆微信
输入你要轰炸的人的微信备注(!!!必定要是微信好友的备注,没有备注请添加备注)
输入要轰炸的内容
按回车键开始轰炸
如何退出
按Ctrl + C 退出轰炸
最后,真的谨慎使用,骚操做而已,不要用这个去搞事情哦~
想了解更多Python知识,Python骚操做的朋友,能够加群私聊我哦,705673780