I am new to python programming. I am trying to make a GUI with stoppable threads. I borrowed some code from https://stackoverflow.com/a/325528
class MyThre
import threading
import time
class MultiThreading:
def __init__(self):
self.thread = None
self.started = True
def threaded_program(self):
while self.started:
print("running")
# time.sleep(10)
def run(self):
self.thread = threading.Thread(target=self.threaded_program, args=())
self.thread.start()
def stop(self):
self.started = False
self.thread.join()