摘要: 方法一: file = open("test.txt", 'w').close() 直接清空“test.txt”里面的内容 方法二: with open("test.txt", 'r+') as file: file.truncate(0) 阅读全文
posted @ 2020-03-19 20:30 profesor 阅读(32298) 评论(0) 推荐(1) 编辑