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
examples
see more specific examples in handler
Release files for thefilewatch 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| thefilewatch-0.0.8.tar.gz | 2.5 kB | Details |
Release files / thefilewatch-0.0.8.tar.gz
| Download URL | thefilewatch-0.0.8.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9faaba5680d45d74132e6e79d7a66fa37e303b5f2fddd886a206b7cf75cc40d9
|
|
BLAKE2b-256 checksum How to use checksums |
64d53c22859edf2896e6033d4580494151a56ae221fbc31b7bc210cce576645c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4
|