Adding BOM (unicode signature) while saving file in python September 14, 2023 by Tarik Write it directly at the beginning of the file: file_new.write('\ufeff')