def start_watch(path, callback):
observer = Observer()
observer.schedule(MyFileSystemEventHandler(restart_process), path, recursive=True)
observer.start()
log('Watching directory {}...'.format(path))
start_process()
try:
while True:
time.sleep(2)
except KeyboardInterrupt:
observer.stop()
observer.join()
评论列表
文章目录