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