importos target_dir=r'C:\avsm'utf8_bom=b'\xef\xbb\xbf'forfilenameinos.listdir(target_dir):filepath=os.path.join(target_dir,filename