Skip to main content

multi-files watcher

Project description

the file watch

Downloads

  • capable to watch multi files at the same time.
  • base on pyinotify
  • easy to use

install

$ pip install thefilewatch

how to use

import sys
from thefilewatch.file_watch import BaseWatchHandler, FileWatch

class PrintHandler(BaseWatchHandler):

    def process(self, content):
        print('getting content ', content)


if __name__ == '__main__':
    if len(sys.argv) < 2:
        print('need watch files')
        exit(1)
    else:
        file_list = sys.argv[1:]
    
    watcher = FileWatch(file_list, PrintHandler())
    watcher.start()

start watching files

$ python -m thefilewatch.file_watch a.txt b.txt

examples

see more specific examples in handler

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thefilewatch-0.0.7.dev0.tar.gz (2.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page