def read_account(filename):
with open(filename, 'r+', encoding='utf-8') as f:
res = f.readlines()
print(res)
f.seek(0)
f.truncate()
def read_account(filename):
with open(filename, 'r+', encoding='utf-8') as f:
res = f.readlines()
print(res)
f.seek(0)
f.truncate()
本文标题:python清空文件内容
本文链接:https://www.haomeiwen.com/subject/tewdoftx.html
网友评论