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

相关推荐
linuxxx1106 小时前
python变量引用的小案例
python
2501_936146047 小时前
烟草叶片病害检测_YOLO11-C3k2-MSBlock模型详解
python
Data_agent7 小时前
Python 编程实战:函数与模块化编程及内置模块探索
开发语言·python
十铭忘7 小时前
windows系统python开源项目环境配置1
人工智能·python
Generalzy7 小时前
langchain deepagent框架
人工智能·python·langchain
栈与堆7 小时前
LeetCode 19 - 删除链表的倒数第N个节点
java·开发语言·数据结构·python·算法·leetcode·链表
万行8 小时前
机器学习&第二章线性回归
人工智能·python·机器学习·线性回归
nervermore9908 小时前
3.3 Python图形编程
python
zhengfei6118 小时前
世界各地免费电视频道的 M3U 播放列表。
python
心静财富之门8 小时前
退出 for 循环,break和continue 语句
开发语言·python