study-planner
study-planner copied to clipboard
Add different file formats for doc type
Other than .pdf, add .pptx, .ppt, .doc, .docx, etc...
For .pptx python-pptx seems the best choice, but it fails to open any older .ppt file. Luckily it looks like these guys have worked it out quite well for .ppt files.
Example of working code on Windows:
import aspose.slides as slides
import os
def print_number_of_slides_with_aspose_slides(file_name):
prs = slides.Presentation(file_name)
print(f"Presentation '{file_name}' has {len(prs.slides)} slides.")
for file in os.listdir("ppt"):
print_number_of_slides_with_aspose_slides(os.path.join("ppt", file))
The issue here is that at https://docs.aspose.com/slides/python-net/features-overview/ we read:
The platforms Aspose.Slides for Python via .NET can be used on Windows x64 or x86 and wide range of Linux distributions with Python 3.5 or later installed.
so no macOS support (pip outputs ERR: Could not find a version that satisfies the requirement aspose.slides (from versions: none)