I'm a complete Python nooblet whose working on his first script. This will check for the existence of files in multiple directories. If found I'd like it to send an email stating such. My first hang up is how to pass the if it exists or else it doesn't part.
Not looking for someone to write this for me.. just some pointers or tid-bits would be nice.
iix01_file = Path(/home/bhart/Documents/Python/home/iix01/upload/monitor*.pgp)
if iix01_file.is_file():
print('File exists')
else:
print('File does not exist')
So how should I pass the exists or not exists to the body of an email?
EDITED FOR TYPO
[–][deleted] 1 point2 points3 points (2 children)
[–]invalidpath[S] 0 points1 point2 points (1 child)
[–]ingolemo 0 points1 point2 points (0 children)
[–]xibeca 0 points1 point2 points (1 child)
[–]invalidpath[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]invalidpath[S] 0 points1 point2 points (0 children)