📅  最后修改于: 2022-03-11 14:45:58.685000             🧑  作者: Mango
fd=open("file.txt","r")
d=fd.read()
fd.close()
m=d.split("\n")
s="\n".join(m[:-1])
fd=open("file.txt","w+")
for i in range(len(s)):
fd.write(s[i])
fd.close()