I am trying to write a python script that automatically sends an email when a specific file is generated. I think i have the code for sending the email, but im not sure how to monitor a directory looking for a specific file.
a high level example is:
from within directory foo/
when file baz is populated do sendEmail()
import os.path if os.path.exists(file_path) and os.path.isfile(fname): send_email()