如何观察目录的变化?
在 python 核心中找不到任何东西来执行此操作。谁能推荐一个库或“电池”来做到这一点?理想情况下,我希望它是可移植的,但如果它仅适用于 Unix(我的服务器)也没关系。
Could not find anything in python core to do this. Can anyone recommend a library or "battery" to do this? Ideally I would like this to be portable but it's OK if it is available only for Unix (my server).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
感兴趣
其他相关库:
On Linux, you could be interested in pyinotify
Other related libraries:
我认为没有可移植的东西可以满足这种要求。
在我看来,这与操作系统太接近了。
否则,对于 Linux,有 pynotify。
pyinotify 是 Linux inotify 内核文件系统通知子系统的绑定。
效果很好。
I don't think there's something portable for this kind of requirement.
That's too close to the OS IMO.
Otherwise for Linux, there's pynotify.
pyinotify is a binding for Linux inotify kernel filesystem notification subsystem.
Works quite well.
我只是在寻找一个可以监视文件修改的 python 包。刚刚偶然发现了pywatch,它可能正是您正在寻找的东西。它非常简单,但是满足了我的需要(修复 pyScss 缺少观察者)。
http://pypi.python.org/pypi/pywatch
I was just looking for a python package that watches file modifications. Just stumbled upon pywatch and it might just be what you're looking for. It's very simple, but does what I need (fixing pyScss' lack of a watcher).
http://pypi.python.org/pypi/pywatch