You can use giowhich is part of the GLib file system (in python GLib bindings)
import gio
def directory_changed(monitor, file1, file2, evt_type):
if (evt_type in (gio.FILE_MONITOR_EVENT_CREATED,
gio.FILE_MONITOR_EVENT_DELETED)):
print "Changed:", file1, file2, evt_type
gfile = gio.File(".")
monitor = gfile.monitor_directory(gio.FILE_MONITOR_NONE, None)
monitor.connect("changed", directory_changed)
however, your program must run GLIL mainloop to receive events. One quick way to check this out:
import glib
ml = glib.MainLoop()
ml.run()
GLib - , . , .
, Fedora Core 2. 2? , GIO GLib. Pyinotify, , , .