def exact_content():
contend = ''
f_in = open(dat_dir, 'r', encoding='utf-8')
total = len(f_in.readlines())
f_in.close()
if os.path.exists(out):
os.remove(out)
f_out = open(out, 'w', encoding='utf-8')
with open(dat_dir, 'r', encoding='utf-8') as f_in:
for line in tqdm(f_in, total=total) :
# time.sleep(1)
x = '<content>'
y = line[0:min(len(x),len(line))]
if operator.eq(x, y) == True:
contend = line[len(x):len(line)-len(x)] + '\n'
f_out.write(contend)
# print(contends)
f_out.close()
评论列表
文章目录