I've an instagram bot with GUI's. There is two class with different .py files. I start the functions with GUI's with no problem but since the functions takes long time and until not completed GUI's are freezing. Therefore i cannot click the stop button thats my problem. I tried using threads it leads to not freezing but i cannot stop it. Therefore i need help I return the beginning. What is the easiest way to prevent freezing?
These are brief GUI's code
def send_requests(self):
username = self.username_entry2.get()
self.bot.send_requests_following(username)
def stop_bot(self):
self.bot.stop()
if __name__ == '__main__':
root = tk.Tk()
app = App(root)
root.protocol("WM_DELETE_WINDOW", app.on_closing)
root.mainloop()
root.destroy()
This is my bot function on other class.
def send_requests_following(self,profile):
I really don't know what to do. Thank you.