pptx 文件版面分析-- python-pptx(python 文档解析提取)

安装

sql 复制代码
pip install python-pptx -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed

pptx 解析代码实现

python 复制代码
from pptx import Presentation
file_name = "rag_pptx/test1.pptx"
# 打开.pptx文件
ppt = Presentation(file_name)
for slide in ppt.slides:
	#print(slide)
	for shape in slide.shapes:
		if shape.has_text_frame:
			text_frame = shape.text_frame
			print(text_frame.text)

参考
【非一般程序员训练营 第二季 ------ RAG 潘多拉宝盒 任务二 版面分析模块】
python-pptx库中文文档及使用样例
pypi/python-pptx/
英文文档
中文文档

相关推荐
SunnyDays1011几秒前
如何使用 Python 从 Word 文档中提取图片
python·word
2601_962097365 分钟前
Pathway 实时RAG新方案:抛弃Spark、Flink,生产级数据管道
python·流处理·大数据集群·实时rag·pathway
三十岁老牛再出发18 分钟前
9月3日总结
python
2601_9622998828 分钟前
Linux下运行Python脚本
linux·python·ubuntu·脚本·命令
IT毕设实战小研29 分钟前
基于大数据的DAX40成分股金融新闻情感趋势可视化分析
android·大数据·python·考研·金融·课程设计
三十岁老牛再出发34 分钟前
8月27日总结
python·pandas
砚底藏山河35 分钟前
【量化纯GET实战 #21】用 pandas 做分析:把接口数据变成 DataFrame
java·python·金融·maven·pandas
Carl_奕然1 小时前
【智能体】Agent的四种设计模式之:React(2026最新版)
javascript·人工智能·python·react.js·设计模式·语言模型
岁月宁静1 小时前
四、《从零手撸 Agent》 — 流式输出:接住 AI “一个字一个字” 想出来的过程
python·agent
是吕先森1 小时前
【python】selenium实现web自动化测试
前端·python·selenium