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

相关推荐
仙人掌_lz17 分钟前
深入理解蒙特卡洛树搜索(MCTS):python从零实现
人工智能·python·算法·ai·强化学习·rl·mcts
chicpopoo20 分钟前
Python打卡DAY30
开发语言·python
IT北辰1 小时前
使用Python与正则表达式高效提取Excel中的票号数据
python·正则表达式·excel
yk 坤帝1 小时前
用Python将 PDF 中的表格提取为 Excel/CSV
python·pdf·excel
为啥全要学1 小时前
PyTorch模型保存方式
pytorch·python
酷爱码1 小时前
python如何遍历postgresql所有的用户表
python·postgresql·oracle
广药门徒2 小时前
OpenMV IDE 的图像接收缓冲区原理
前端·人工智能·python
搂……住2 小时前
第二道re
python
qq_584598922 小时前
day30python打卡
开发语言·人工智能·python·算法·机器学习
火兮明兮2 小时前
Python训练第三十天
开发语言·python