def observe_with(observer, event_handler, pathnames, recursive):
 for pathname in set(pathnames):
  observer.schedule(event_handler, pathname, recursive)
 observer.start()
 try:
  while True:
   time.sleep(1)
 except KeyboardInterrupt:
  observer.stop()
 observer.join()

def observe_with ( observer , event_handler , pathnames , recursive ) : for pathname in set ( pathnames ) : observer . schedule ( event_handler , pathname , recursive ) observer . start ( ) try : while True : time . sleep ( 1 ) except KeyboardInterrupt : observer . stop ( ) observer . join ( )
single observer thread with a scheduled path and event handler .