#!/usr/bin/env python3 with open("lang/calamares_en.ts") as lang: result = [] for line in lang: if '' in line: line = f'\n' if '' in line: line = f'\n' if " 0: with open("lang/calamares_en_mod.ts", mode = "wt+") as lang_mod: lang_mod.writelines(result)