diff --git a/dsRag/Test/TestReadMathType.py b/dsRag/Test/TestReadMathType.py index 3ad4b5fe..5fa5c3c5 100644 --- a/dsRag/Test/TestReadMathType.py +++ b/dsRag/Test/TestReadMathType.py @@ -12,5 +12,7 @@ output_file = r"d:\output.txt" # 可修改为您需要的路径 command = mtef + r" -w " + sourceDocx + " -o " + output_file os.system(command) # 把output.txt里的内容打印出来看看 +# 加上行号 with open(output_file, 'r', encoding='utf-8') as file: - print(file.read()) + for i, line in enumerate(file): + print(f"{i+1}: {line.strip()}")