To complete the picture, there is not enough answer with
import logging import Inotify.adapteS_default_log_format = ' %(asctime) s - %(name) s - %(LEVELNAME) S - %(Message) S' SPAN> _LOGGGER = logging.getlogger (__ name __) def _ configure_loging (): _logger.setlevel (logging.debug) ch = Loging.streamHandler () Formatter = logging.formatter (_default_log_format) ch.setformatter (Formatter) _logger.addhandler (ch) def _ main (): i = inotify.adapters.inotify () i.add_watch ( ''/tmp ') try : for event in i.event_gen (): if event is not none : (Header, Type_names, Watch_path, Filename) = Event _LOGGER.info ( "" WD = (%D) MASK = (%D) cookies = (%D) LEN = (%D) MASK- & GT; Names =%S "" "Watch-Path = [%S] Filename = [%S]" "" span>, , Header.wd, Header.mask, Header.cookie, Header. Len , Type_Names, Watch_Path) finally : I.remove_watch ( ''/tmp ') if __name__ == ' '__ main __' : _configure_logging () . _main () I.Event_GEN () yILD-VILD Events about changing files in the catalog.