I have a block of code that i am wanting to turn into a function and i am very ocnfused on how to do it properly. If anyone could give me a lead on how to do this it would be a great help. The for statement is where i want to call the function so taht it loops through the folder its searching.
for filename in glob.glob(fileFull): statinfo = os.stat(filename) for Filename in glob.glob(fileAbriv): Statinfo = os.stat(Filename) SUBJECT = 'File size of '+fileFull Subject = 'File size of '+fileAbriv BODY = 'The file size of '+fileFull+' was greater than '+str(statinfo.st_size)+'.' Body = 'The file size of '+fileAbriv+' was greater than '+str(Statinfo.st_size)+'.' if args.changesize >= str(statinfo.st_size): sendEmail(args.reciveEmail, SUBJECT, BODY) elif args.changesize < str(statinfo.st_size): print (statinfo.st_size) print (fileFull) if args.changesize >= str(Statinfo.st_size): sendEmail(args.reciveEmail, Subject, Body) elif args.changesize < str(Statinfo.st_size): print (Statinfo.st_size) print (fileAbriv)