Skip to content

Commit 76a4014

Browse files
committed
pdf读取和美化输出
1 parent 772e054 commit 76a4014

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

basic/myutils/pdf/perfect_lines.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def beauty(txt_file):
2323
f.truncate()
2424

2525

26-
def beauty2(txt_file):
27-
with open(txt_file, mode='r', encoding='utf-8') as f:
26+
def beauty2(pre_txt, after_txt):
27+
with open(pre_txt, mode='r', encoding='utf-8') as f:
2828
lines = f.readlines()
2929
result_lines = []
3030
for i, line in enumerate(lines):
@@ -43,9 +43,9 @@ def beauty2(txt_file):
4343
result_lines.append(line)
4444

4545
# 结果写入
46-
with open(txt_file, mode='w', encoding='utf-8') as f:
46+
with open(after_txt, mode='w', encoding='utf-8') as f:
4747
f.writelines(result_lines)
4848

4949

5050
if __name__ == '__main__':
51-
beauty2('pc.txt')
51+
beauty2('pc_pre.txt', 'pc_after')

0 commit comments

Comments
 (0)