Runs Python functions once a certain file is created or modified.
Project description
FileWatchdog
Runs Python functions once a certain file is created or modified.
Installation
pip install filewatchdog
Usage
import filewatchdog as watcher
import time
def job():
print("I'm working...")
files = ['C:/Temp/1.txt', 'C:/Temp/2.txt', 'C:/Temp/3.txt']
watcher.once().one_of(files).modified.do(job)
watcher.once().all_of(files).exist.do(job)
while True:
watcher.run_pending()
time.sleep(1)
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
filewatchdog-0.0.2.tar.gz
(3.9 kB
view hashes)