""" conda activate rag pip install python-docx """ from Util.WordUtil import * # 使用示例 if __name__ == "__main__": word_file = R"D:\办公\【曲靖】技术参数_教育数据基座20250525(1).docx" content = read_word_file(word_file) if content: # 逐行打印,空行不打印 for line in content.split("\n"): if line.strip(): print(line)