import pyautogui import tkinter import sys from tkinter import * def delete(): while True: pyautogui.click() pyautogui.press('up') pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') for x in range(3): pyautogui.press('enter') pyautogui.sleep(5) if not window: continue break def stop(): exit() window = Tk() button = Button(window, text='Stop running!', padx=50, pady=50, command=stop) button.pack() button2 = Button(window, text='Start running!', padx=50, pady=50, command=delete) button2.pack() window.mainloop()
So i tested both buttons on their own and they work perfectly but the only issue is, when i call the function "delete" when i press button2 and i go into a text box so it deletes messages and then i go back into the GUI it stops responding and winds up crashing the app, how do i fix this?
Last edited by a moderator: