from tkinter import *
import time
import pyautogui
import threading
p = Tk()
def a():
while True:
time.sleep(3)
pyautogui.press("a")
def b():
t1 = threading.Thread(target=a)
t1.start()
button = Checkbutton(p, command=b).pack()
p.mainloop()
1 Beğeni