0

I have a GUI and a button that toggles an observer.

def start(self):
    self.observer.schedule(event_handler=update, path=self.path, recursive=False)
    self.observer.start()

def stop(self):
    self.observer.unschedule_all()
    self.observer.stop()
    self.observer.join()

But when I run the start method again I get a RunTimeError: threads can only be started once

Lyndsy Simon
  • 5,208
  • 1
  • 17
  • 21
cre8
  • 13,012
  • 8
  • 37
  • 61
  • 2
    You're probably getting that error because you're trying to start a thread more than once and threads can't be started more than once. – Kevin Sep 10 '15 at 18:57
  • I put the start call in the constructor and it works. Thought the stop function is the opposite of the start function – cre8 Sep 10 '15 at 19:00

0 Answers0