监听文件变化 发表于 2019-06-27 更新于 2022-06-16 import pyinotify wm = pyinotify.WatchManager() notifier = pyinotify.Notifier(wm) wm.add_watch('/tmp/', pyinotify.ALL_EVENTS, rec=True) notifier.loop()