Question : using inotify with python

I just got helped making a script to move a bunch of files into directories.  How do i have that fire off everytime a new file iss added to a directory?

Answer : using inotify with python

Do you want this in python, or to call your python program?

you can call your program like this:

inotifywait -m -e create -e moved_to -q --format %w%f watched_dir(s) | \
while read file
do
   echo "your_prog $file"
done


after testing, replace the echo line with just
your_prog $file
Random Solutions  
 
programming4us programming4us