I cant use bucles with tkinter cause it stops responding, i tried with while and for, i know there are more questions like this but i didnt understood, so guys please help me, i need ur help and yes im writting more because this isnt letting me post cause i have to add details
import time
spam_delay=0.001
spam_keys="cerdo"
spam_range=70
class spammer():
def __init__(self,delay,keys):
self.delay=spam_delay
self.keys=spam_keys
self.started=False
**def start(self):
self.started=True
self.run()
def run(self):
if self.started:
for i in range(spam_range):
time.sleep(spam_delay)
pyautogui.typewrite(spam_keys)
pyautogui.press("enter")
time.sleep(0.1)**
def stop(self):
if self.started:
self.started=False
spamerV2=spammer(spam_delay,spam_keys)
from tkinter import *
root=Tk()
root.title("Spammer_V2.0")
root.resizable(1,1)
Frame=Frame(root, width=400, height=600)
Frame.pack()
Label=Label(Frame, text="papu")
Label.grid(row=0, column=0,sticky="e", padx=10,pady=10)
Entry_Text=Entry(Frame)
Entry_Text.grid(row=0, column=1,sticky="e", padx=10,pady=10)
**btn=Button(root,text="papuu",command=spamerV2.start)
btn.pack()**
btn2=Button(root,text="apaga", command=spamerV2.stop)
btn2.pack()
root.mainloop()```