class ModHandler(pyinotify.ProcessEvent):

    def process_IN_CLOSE_WRITE(self, evt):
        webbrowser.open(URL)
handler = ModHandler()
wm = pyinotify.WatchManager()
notifier = pyinotify.Notifier(wm, handler)
How can I "watch" a file for modification / change?