We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 772e054 commit 76a4014Copy full SHA for 76a4014
basic/myutils/pdf/perfect_lines.py
@@ -23,8 +23,8 @@ def beauty(txt_file):
23
f.truncate()
24
25
26
-def beauty2(txt_file):
27
- with open(txt_file, mode='r', encoding='utf-8') as f:
+def beauty2(pre_txt, after_txt):
+ with open(pre_txt, mode='r', encoding='utf-8') as f:
28
lines = f.readlines()
29
result_lines = []
30
for i, line in enumerate(lines):
@@ -43,9 +43,9 @@ def beauty2(txt_file):
43
result_lines.append(line)
44
45
# 结果写入
46
- with open(txt_file, mode='w', encoding='utf-8') as f:
+ with open(after_txt, mode='w', encoding='utf-8') as f:
47
f.writelines(result_lines)
48
49
50
if __name__ == '__main__':
51
- beauty2('pc.txt')
+ beauty2('pc_pre.txt', 'pc_after')
0 commit comments