code: def watch_for_events():
      
      fd = inotify.init()
      try:
          wd = inotify.add_watch(fd, '/tmp', inotify.IN_CLOSE_WRITE)
          while True:
              for event in inotify.get_events(fd):
                  print("event:", event.name, event.get_mask_description())
      finally:
          os.close(fd)
docs: Wait for events and print them to stdout.