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).
On Linux, you could be interested in pyinotify
- https://github.com/seb-m/pyinotify
Other related libraries:
- http://people.gnome.org/~veillard/gamin/python.html
- Python FAM interface: http://python-fam.sourceforge.net/
- http://gorakhargosh.github.com/watchdog/
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.
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
精彩评论