""" conda activate rag pip install python-docx """ from Util.WordUtil import * # 使用示例 if __name__ == "__main__": word_file = r"../Txt/小学数学知识点.docx" content = read_word_file(word_file) if content: # 逐行打印,空行不打印 for line in content.split("\n"): if line.strip(): print(line)