删除txt文件里的 聊天记录的时间那一行
f = open("d:\\面试.txt", "r") g = open("d:\\英雄联盟ADC技巧.txt", "w") for line in f.readlines(): if "21:" not in line: g.write(line) f.close() g.close()
删除txt文件内容
原文:http://www.cnblogs.com/bingxing/p/7392996.html