I am trying to create an animation. The major libraries I use are Tkinter and Threads.
Function1{
while 1{
#code
}
}
function2{
#one button element
#if button element is clicked
# create a thread object to invoke the Function 1
}
I am facing a problem that while running the program, sometimes it shows interface and then gets stucks and sometimes it just runs smoothly.
I also have a stop button to exit thread. In that I am setting a variable value to 1 such that when this variable is checked for value change in the thread the while loop get breaked. Is that the best way to exit a thread??