Hello everyone , I meet you again , I'm your friend, Quan Jun .
I've seen some programs used to swipe the screen , Or you can only brush the screen QQ, Or you can only brush the screen WeChat , Today, bloggers come to realize it together , And the usage is super simple !!!, I hope I can help you !
I don't say much nonsense , On the first code , Then we will introduce it in detail !!!
from pynput import mouse, keyboard
from tkinter import *
import tkinter.filedialog
import time
root=Tk()
root.title(" Information swipe screen ")
root.geometry("550x200+500+300")
lb=Label(root,text=' reminder : Be careful of being deleted !!!',bg='red',font=(' Chinese regular script ',15))
lb.grid(row=0,column=0)
lb=Label(root,text=" Please enter what you want to send :",font=(' Chinese regular script ',15))
lb.grid(row=2,column=0)
entry1=Entry(root,font=('Arial',15))
entry1.grid(row=2,column=1)
lb=Label(root,text=" Please enter the number of times to send :",font=(' Chinese regular script ',15))
lb.grid(row=3,column=0)
entry2=Entry(root,font=('Arial',15))
entry2.grid(row=3,column=1)
m=mouse.Controller()
k=keyboard.Controller()
def anjian():
m.position=(69,803)
time.sleep(0.5)
m.click(mouse.Button.left)
for i in range(int(entry2.get())):
time.sleep(0.2)
k.type(entry1.get())
time.sleep(0.5)
k.press(keyboard.Key.enter)
k.release(keyboard.Key.enter)
btn=Button(root,text=" refresh ",font=(' Chinese regular script ', 12),relief="raised", width=8, height=1,bd="6",command=anjian)
btn.grid(row=4,column=1)
root.mainloop()
Use the tutorial 1. First, let's run the program , Before running the program, you need to install a third-party library (pynput library ), The specific installation process will not be described in detail , You can refer to Third party library installation 2. After the program runs, you will see the following interface :
3. Open the to be swiped QQ Or wechat dialogue interface , And maximize ( Remember to maximize !!!), Such as :
4. The last step , Input the contents and times of screen brushing in the screen brushing program interface , Just click "swipe the screen" , Such as :
Wechat demo :
QQ demonstration :
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/132209.html Link to the original text :https://javaforall.cn