multi-files watcher
Project description
the file watch
- 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
Project details
Release history Release notifications | RSS feed
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.4.tar.gz
(2.3 kB
view hashes)