Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyThread(Thread):
- def __init__(self, event)):
- Thread.__init__(self)
- self.stopped = event
- def run(self):
- while not self.stopped.wait(1): # 1 second for sake of example
- self.task()
- def task(self):
- print("my long task")
Add Comment
Please, Sign In to add comment