zoukankan      html  css  js  c++  java
  • python | 微信轰炸脚本代码

    一、环境准备

    1、Python3.6

    2、itchat第三方库

    pip install itchat

    3、pyinstaller第三方库

    pip install pyinstaller

    二、核心代码

     

    import itchatimport time

    print("请扫描弹出的扫二维码")itchat.auto_login(hotReload=True)
    boom_name = input("请输入想发送的人:")
    message = input("请输入发送的内容:")
    number = int(input("请输入发送的次数:"))
    boom_obj = itchat.search_friends(remarkName=boom_name)[0]['UserName']
    for i in range(1,number+1):

    time.sleep(0.01)

    print("正在发送第%d遍" %i)

    itchat.send_msg(msg=message,toUserName=boom_obj)

    三、项目打包成可执行文件

    为了方便程序的运行,Python提供了第三方库pyinstaller可以很方便的将项目打包成可执行的exe程序,安装方法:pip install pyinstaller

    1、使用方法:

    -F 选项可以打出一个exe文件,默认是 -D,意思是打成一个文件夹。
    -w 选项可以打桌面程序,去掉命令行黑框

    -i 可以设置图标路径,将图标放在根目录 pyinstaller -F -i cat.ico demo.py
    下载图标:https://www.easyicon.net/

    在这里我们需要打开项目所在的cmd命令框输入:

    pyinstaller -F wechat.py

    等待项目执行完毕即可,此时可执行文件就存在dist文件夹中。

  • 相关阅读:
    c# 测试篇之Linq性能测试
    F# 笔记
    c# DataSource和BindingSource
    .net中配置的保存格式笔记
    泛型约束(转)
    c# 调用showDialog后需要Dispose
    c# 实现ComboBox自动模糊匹配
    c# 二进制或算法实现枚举的HasFlag函数
    C# WinForm自定义控件整理
    微软中文MSDN上的一些文章链接
  • 原文地址:https://www.cnblogs.com/huangjiangyong/p/15654596.html
Copyright © 2011-2022 走看看