📅  最后修改于: 2022-03-11 14:47:18.095000             🧑  作者: Mango
with open("yourfile.txt", "r") as f:
lines = f.readlines()
with open("yourfile.txt", "w") as f:
for line in lines:
if line.strip("\n") != "nickname_to_delete":
f.write(line)