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

相关推荐
YYXZZ。。1 分钟前
PyTorch——搭建小实战和Sequential的使用(7)
人工智能·pytorch·python
四川兔兔5 分钟前
pytorch 与 张量的处理
人工智能·pytorch·python
AI蜗牛之家4 小时前
Qwen系列之Qwen3解读:最强开源模型的细节拆解
人工智能·python
whyeekkk4 小时前
python打卡第48天
开发语言·python
Eiceblue6 小时前
Python读取PDF:文本、图片与文档属性
数据库·python·pdf
weixin_527550406 小时前
初级程序员入门指南
javascript·python·算法
程序员的世界你不懂7 小时前
Appium+python自动化(十)- 元素定位
python·appium·自动化
CryptoPP8 小时前
使用WebSocket实时获取印度股票数据源(无调用次数限制)实战
后端·python·websocket·网络协议·区块链
树叶@8 小时前
Python数据分析7
开发语言·python
老胖闲聊9 小时前
Python Rio 【图像处理】库简介
开发语言·图像处理·python