I have written a script with will check .docx file format in a particular format and give me the output on print function.
import glob
if glob.glob('//gbhfrd01/directorates/Business Support/Test/john//Python/*.docx'):
print("File exist")
else:
print("File not exist")
I want to send email based on the output of the print funtion. For example if "File not Exist" send email to abc@test.com.
I have seen online how to send email with python but i don't know how can i send email based on the out put of my print function.
Any help on this would be really greatful.