I am new to python and watchdog, and was confused by the quickstart example. In the example, there is a block of code like this:
self.observer.start()
try:
while True:
time.sleep(5)
except:
self.observer.stop()
print('Error')
self.observer.join()
I couldn't find any documentations about the start
, stop
and join
method. Also, although knowing that the while loop inside try except probably makes the observer run for every 5 seconds, I don't understand how does it work?
Could anyone explain me what do the three methods do and how does the loop work?