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).
Asked
Active
Viewed 8.0k times
26
-
Some more answers here: http://stackoverflow.com/questions/182197/how-do-i-watch-a-file-for-changes-using-python – Spaceghost Jan 16 '11 at 22:42
3 Answers
11
On Linux, you could be interested in pyinotify
Other related libraries:

MonkeyDreamzzz
- 3,978
- 1
- 39
- 36

pyfunc
- 65,343
- 15
- 148
- 136
-
[inotify_simple](https://github.com/chrisjbillington/inotify_simple) is pretty good and much simple than pyintoify in my opinion – Hawker65 Jun 29 '18 at 09:46
5
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.

MonkeyDreamzzz
- 3,978
- 1
- 39
- 36

Alain Pannetier
- 51
- 1
-
I too had the same understanding that this can't be portable. Luckily my hosting is in Linux and so pynotify is quite suffice. Some developers still use win but i actually don't expect them to use or work on this module. – Gnu Engineer Jan 16 '11 at 23:59
4
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).

roberkules
- 6,557
- 2
- 44
- 52