netdzb 当前离线
上尉
Gin_Q 当前离线
五级士官
#coding=utf-8 file = 'NEWS.txt' content = [] par = b'hello' with open(file, 'rb') as f: for n in f: if n[:5] == par: content.append(n) with open(file, 'wb') as f: f.writelines(content)复制代码
TOP