Skip to main content

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.1.tar.gz (3.8 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