Questions tagged [python-pptx]

python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.

python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.

Latest documentation

Available from pypi.

734 questions
0
votes
1 answer

How to save PPT file as PPTX file using Python? or How to ready PPT file using python-pptx?

i've tried with below code but i couldn't save PPT file as PPTX file. from pptx import Presentation import os import glob for each_file in glob.glob("C:/Users/Downloads/*.ppt"): #prs = Presentation(each_file) …
0
votes
1 answer

python-pptx not able to extract text from certain Powerpoint Presentations, but others work fine

Attempting to extract text fields from a large directory of .pptx files, the below script works perfectly for some Powerpoint Presentations: from pptx import Presentation import glob f = open("Scraped PPTX Data.txt", "a", encoding='utf-8') for…
0
votes
1 answer

How to read PowerPoint SmartArt Data using python ? Python-PPTX

slides=prs1.slides for slide in prs1.slides: ImageData.insert(1, "Slide "+str(slides.index(slide)+1)) TextData.insert(1, "Slide "+str(slides.index(slide)+1)) for shape in slide.shapes: if 'Picture' in…
0
votes
1 answer

Set data labels text frame wrap to false – python-pptx

I am asking a duplicate of this question, except that the answer submitted does not work for me. I would like to toggle the data_labels' "Wrap text in shape" button from the powerpoint UI via python-pptx. The linked answer ends up removing the data…
Ludo
  • 2,307
  • 2
  • 27
  • 58
0
votes
1 answer

How to split a multiple-slides pptx file into separate ones by python-pptx?

Suppose there's a ppt file containing multiple slides, say 8 slides in one pptx file. Is there any way of splitting this pptx file into 8 separate pptx files by #python-pptx#?
0
votes
1 answer

excuse me how to rename the slide master by pypptx or win32com

How to rename the slide master by pypptx or win32com? I found the following code can read the name, but it can not rename. Please tell me how I can do that? # coding: utf8 from pptx import Presentation from pptx.oxml import parse_xml from…
caedy
  • 3
  • 1
0
votes
1 answer

How to extract ALL IMAGES and text from all pptx file slides using python?

I'm able to read images from pptx file but not all images. I'm unable to extract the images presented in a slide with title or other text. Here is my code and please help me. from pptx import Presentation from pptx.enum.shapes import…
0
votes
1 answer

python - source code string cannot contain null bytes

I tried to find the mistake within my code but I couldn't and in addition I tried to use the command:"sed -i 's/\x0//g' filename" but nothing changed. Maybe someone can help me. Thank you in advance! from pptx import Presentation from pptx.dml.color…
0
votes
2 answers

pairing one picture to multiple pictures in folder

I have some pictures in the folder I want to pair so I can add them to my slide with iterative fashion. I want to pair pictures ending with mp ones to bp ones. One caveat is that there are multiple pictures ending with bp and bp so that adding…
Alexander
  • 4,527
  • 5
  • 51
  • 98
0
votes
1 answer

Adding video in ppt using python cannot be played

I have to insert a video in ppt using python-pptx library. And also i have added the below code to insert it: from pptx import Presentation from pptx.util import Inches prs = Presentation('template.pptx') filepath = "file2.pptx" layout = …
Lavii
  • 63
  • 1
  • 4
0
votes
1 answer

Python pptx - creating chart with multiple categories?

is it possible to create a chart in python with multiple categories? For example: I copy pasted this in powerpoint, loaded it and tried this: presentation.slides[0].shapes[0].chart.plots[0].categories.flattened_labels which gave me all the labels…
davoro
  • 53
  • 3
0
votes
1 answer

Python-pptx Library - printing Category Name

Is there a method to print the category name of a series in the chart from pptx import Presentation from pptx.chart.data import ChartData shape = slide_11.shapes[5] ReachChart = shape.chart reach_data = ChartData() reach_data.categories = ['reach…
Santhosh K
  • 13
  • 4
0
votes
2 answers

Python Insert image from fifth slide

I have a folder with images which I am inserting into a PPTX file I am generating. The below code inserts the images starting with the first slide but I want it to start inserting images from the fifth slide onward. I am unable look for a solution…
Python Bang
  • 472
  • 3
  • 17
0
votes
1 answer

How do I remove poster image from video in pptx-python

So I am inserting videos using add_video function in pptx-python. The documentation says one of the inputs is a poster_image for the video. IF this is not set, it shows a huge speaker icon in the video. How do I remove the speaker and not have a…
0
votes
1 answer

How to save python pptx on colab

Is there a way to save the Python pptx file on Google drive or desktop? I tried Prs.save() to save the pptx file, but it doesn't work.
Vandako
  • 1
  • 3