📅  最后修改于: 2022-03-11 14:46:47.307000             🧑  作者: Mango
#!/usr/bin/env python3
import fileinput
with fileinput.FileInput(filename, inplace=True, backup='.bak') as file:
for line in file:
print(line.replace(text_to_search, replacement_text), end='')