复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-pptx-validation-fallback-9d1e5720d8e8 ,按照其中的说明把「pptx-validation-fallback」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use this skill when read_file fails to properly read or validate PowerPoint (.pptx) files. This provides a reliable alternative for verifying presentation contents including slide count, titles, and structure.
If read_file with filetype pptx returns errors, incomplete content, or cannot extract slide information, proceed to the fallback method.
Execute Python code via run_shell using the python-pptx library to inspect the presentation:
from pptx import Presentation
# Load the presentation
prs = Presentation('path/to/file.pptx')
# Get basic info
slide_count = len(prs.slides)
print(f"Total slides: {slide_count}")
# Extract slide titles
for i, slide in enumerate(prs.slides):
if slide.shapes.title:
title = slide.shapes.title.text
print(f"Slide {i+1}: {title}")
else:
print(f"Slide {i+1}: [No title]")
Check that the presentation meets expected requirements:
from pptx import Presentation
prs = Presentation('path/to/file.pptx')
# Validation checks
expected_slides = 10 # Adjust based on requirements
actual_slides = len(prs.slides)
if actual_slides >= expected_slides:
print(f"✓ Slide count OK: {actual_slides} slides")
else:
print(f"✗ Insufficient slides: {actual_slides}/{expected_slides}")
# Check for content on each slide
for i, slide in enumerate(prs.slides):
has_title = slide.shapes.title is not None
has_content = len(slide.shapes) > 1
print(f"Slide {i+1}: title={has_title}, content={has_content}")
For deeper validation, extract text content from all shapes:
from pptx import Presentation
prs = Presentation('path/to/file.pptx')
for i, slide in enumerate(prs.slides):
print(f"\n=== Slide {i+1} ===")
for shape in slide.shapes:
if hasattr(shape, "text") and shape.text.strip():
print(shape.text)
Successful validation should provide:
The python-pptx library must be available in the execution environment. Most Python environments support it via pip:
pip install python-pptx