I have a 'Start' button which starts a function, but also want a button that can end that specific function is there a way I can do this here's my code:
from tkinter import *
from tkinter.ttk import *
root = Tk()
root.geometry('900x900')
def start():
for count in range(100):
Label(root,text='hi').pack()
def stop():
#What code should I use to stop 'def start'
print('')
Button(root,text='stop',command=lambda: stop).pack()
Button(root,text='start',command=lambda: start()).pack()
root.mainloop()
Thanks in advance