Watching a directory for files event in python

watchdog is a python package uses to notify linux kernel subsystem to watch for any changes to the filesystem. This is very handy package Lets create a watcher using watchdog and save information to DB when any event occur. 1. Firstly I will write watcher class which look like import time import psycopg2 from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler class Watcher: DIRECTORY_TO_WATCH =...

Read More