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/
英文文档
中文文档

相关推荐
人工智能技术咨询.27 分钟前
高质量数据集的一致性
python
IT小小猪2 小时前
子进程闪黑窗:pythonw 没有控制台,0x08000000 一个参数解决
运维·windows·python·自动化·进程管理
2601_962885722 小时前
如何用 Python 计算终极振荡器(Ultimate Oscillator, UOS)?
开发语言·python
Thanks_ks2 小时前
Python 列表与元组:可变性与不可变性的差异及使用场景选择
数据结构·python·列表·元组·可变对象·不可变对象·可哈希
benchmark_cc3 小时前
一次获取多只股票实时行情:QuantDash `quotes.get(symbols=[...])` 批量快照
开发语言·python·数据分析·pandas·量化交易·股票数据·quantdash
geovindu3 小时前
python: PCA
开发语言·后端·python·算法
AI模型调用笔记4 小时前
流式 API 的 usage 为 null?用 cURL 看尾帧,别漏空 choices
python
天诰5 小时前
SA-T-06 轨迹数据工程 脏数据检测
人工智能·python·算法·语言模型·ai编程
Java后端的Ai之路6 小时前
Anthropic 官方文章《Building always-on agents》构建指南
开发语言·网络·python
badhope7 小时前
Agent 说发布成功,文章却 404:我补了 4 张回读收据
后端·python·ai编程