找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 文档 工具 设计
查看: 59|回复: 0

Python怼人神器

[复制链接]

1万

主题

871

回帖

2万

积分

超级版主

教育辅助界扛把子

附加身份标识
精华
1
热心
2
听众
1
威望
57
贡献
11861
违规
0
书币
5567
注册时间
2020-4-8

论坛元老灌水之王

发表于 2023-1-27 08:19 | 显示全部楼层 |阅读模式
准备工作:
pip3 install pyperclip

pip3 install pyautogui




话不多说,上代码:
[Python] 纯文本查看 复制代码
from tkinter import *

import time

from pyperclip import copy

import pyautogui as g



root = Tk()

root.title('连续发送器(怼人神器)')

root.geometry('480x400')



def paste(chinese):

    if(v_c.get()==3):

        copy(chinese)

        g.hotkey('command', 'v')

    else :

        copy(chinese)

        g.hotkey('ctrl', 'v')



# pyinstaller -F -w text.py



def a():

    a_g = str(a.get('0.0', 'end'))

    b_g = int(b.get())

    c_g = int(c.get())

    time.sleep(c_g)



    #g.moveTo(1588, 802, duration = 1)



    #g.click()



    if (v_c.get()) == 1:

        for i in range(b_g):

            # 输入l like python

            #g.typewrite(a_g)

            paste(a_g)



            # 按下回车

            g.press('enter')

            time.sleep(0.01)



    elif (v_c.get()) == 2:

        for i in range(b_g):

            # 输入l like python

            #g.typewrite(a_g)

            paste(a_g)



            # 按下回车

            g.press('ctrl'+'enter')

            time.sleep(0.01)

   

    elif (v_c.get()) == 3:

        for i in range(b_g):

            # 输入l like python

            #g.typewrite(a_g)

            paste(a_g)



            # 按下回车

            g.press('enter')

            time.sleep(0.01)



frame = Frame(root)

frame.place(x = 120, y = 50)



b = Button(root, text = '发送(迅速点击发送窗口)', font = ('楷书', 18), command = a)

b.place(x = 10, y = 340)





Label(root, text = ' 内容 ', font = ('楷书', 18)).place(x = 10, y = 50)







gun_song_tiao_y = Scrollbar(frame)



gun_song_tiao_x = Scrollbar(frame, orient=HORIZONTAL)



a = Text(frame, font = ('楷书', 14), fg = 'blue', width=30, height=10 ,wrap='none')



gun_song_tiao_y.pack(side=RIGHT,fill=Y)

gun_song_tiao_x.pack(side=BOTTOM, fill=X)



a.pack()



gun_song_tiao_y.config(command=a.xview)

gun_song_tiao_x.config(command=a.yview)



a.config(yscrollcommand=gun_song_tiao_y.set)

a.config(xscrollcommand=gun_song_tiao_x.set)





Label(root, text = '发送次数', font = ('楷书', 18)).place(x = 10, y = 300)



var1 = StringVar()

var1.set('20')



b = Entry(root, font = ('楷书', 18), fg = 'blue', textvariable=var1)

b.place(x = 120, y = 300)



var = StringVar()

var.set('5')



Label(root, text='准备时间', font = ('楷书', 18)).place(x = 10, y = 10)



c = Entry(root, font = ('楷书', 18), fg = 'blue', textvariable=var)

c.place(x = 120, y = 10)





Label(root, text='发送方式', font = ('楷书', 18)).place(x=10, y=250)



v_c = IntVar()

v_c.set(1)



enter_r = Radiobutton(root ,text='Enter' ,font = ('楷书', 17), variable = v_c, value=1)

enter_r.place(x=120, y=250)



c_enter_r = Radiobutton(root, text='Ctrl+Enter', variable = v_c, value=2 ,font = ('楷书', 17))

c_enter_r.place(x=200 ,y=250)



c_enter_r = Radiobutton(root, text='Enter(MAC)', variable = v_c, value=3 ,font = ('楷书', 17))

c_enter_r.place(x=310 ,y=250)



root.mainloop()



注意事项:
此工具仅限学习使用,请不要用此恶搞他人!
Mac的用户请选择"Enter(MAC)",否则无法正常发送!
在程序运行过程中,未响应属于正常现象!

Great works are not done by strength, but by persistence! 历尽艰辛的飞升者,成了围剿孙悟空的十万天兵之一。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 需要先绑定手机号


免责声明:
本站所发布的第三方软件及资源(包括但不仅限于文字/图片/音频/视频等仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢某程序或某个资源,请支持正版软件及版权方利益,注册或购买,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To: admin@cdsy.xyz

QQ|Archiver|手机版|小黑屋|城东书院 ( 湘ICP备19021508号-1|湘公网安备 43102202000103号 )

GMT+8, 2024-4-20 12:11 , Processed in 0.050037 second(s), 27 queries .

Powered by Discuz! CDSY.XYZ

Copyright © 2019-2023, Tencent Cloud.

快速回复 返回顶部 返回列表