|
发表于 2020-4-14 12:06:31
|
显示全部楼层
帮你改了一下。
- import pyautogui as g
- from tkinter import *
- from tkinter import messagebox as gg
- import time
- from pyperclip import copy
- import pyautogui as g
- root = Tk()
- root.title('连续发送器(怼人神器)')
- root.geometry('400x200')
- def paste(chinese):
- copy(chinese)
- g.hotkey('ctrl', 'v')
- def a():
- a_g = str(a.get())
- b_g = int(b.get())
- time.sleep(2)
- #g.moveTo(1588, 802, duration = 1)
- #g.click()
- for i in range(b_g):
- # 输入l like python
- #g.typewrite(a_g)
- paste(a_g)
- # 按下回车
- g.typewrite('\n')
- b = Button(root, text = '发送(请先点击要发送的位置)', font = ('华文行楷', 18), bg = 'yellow', command = a)
- b.place(x = 10, y = 90)
- Label(root, text = ' 内容 ', font = ('华文行楷', 18), bg = 'yellow').place(x = 10, y = 10)
- a = Entry(root, font = ('华文行楷', 18), bg = 'yellow', fg = 'blue')
- a.place(x = 120, y = 10)
- Label(root, text = '发送次数', font = ('华文行楷', 18), bg = 'yellow').place(x = 10, y =50)
- b = Entry(root, font = ('华文行楷', 18), bg = 'yellow', fg = 'blue')
- b.place(x = 120, y = 50)
- root.mainloop()
复制代码
现在输入中文也行了,但我提个建议:
函数变量名字不要太随意,那个a_g,b_g,
鬼知道你想表达什么意思,说不定你后面忘了呢,
可以改成content和count。 |
评分
-
查看全部评分
|