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
2
votes
1 answer

Visible property of Power point application in win32com under python is not working when set to false

The visible property of Powerpoint application in the win32com package under python is not working when set to 'False'. It was working when the visible property was set to true and the pptx gets opened once the given piece of code executes. I don't…
amt1906
  • 75
  • 3
  • 10
2
votes
1 answer

AttributeError: module 'pptx.chart' has no attribute 'data'

I'm trying to update the chart data on a PowerPoint slide using python-pptx but I keep getting this error: Traceback (most recent call last): File "", line 1, in chart_data =…
StLouisO
  • 49
  • 4
2
votes
1 answer

How to set a background image in python pptx

I am currently working on a project aiming to create a PowerPoint thanks Python pptx. However I am trying to set an image as the background of the slide and I can’t seem to find the solution in the docs of Python pptx. Is it possible to set an image…
2
votes
2 answers

Python-pptx: update or change existing chart data

I open a pptx file and want to change the chart dataset. How can I do that? prs = Presentation("mypresentation.pptx") chart = prs.slides[0].shapes[2].chart I get the chart as above from the slide. I don't want to change the style or any thing of…
asdfkjasdfjk
  • 3,784
  • 18
  • 64
  • 104
2
votes
1 answer

Update linked excel path in PowerPoint via Python

I want to automate creating of a powerpoint ppt via linking template charts to some Excel files. Updating the excel file values changes the powerpoint slides automatically. I have created my powerpoint template and linked charts to sample excel…
ALEX MATHEW
  • 251
  • 1
  • 5
  • 13
2
votes
1 answer

How can I change the font color inside shape with python-pptx?

I am trying to create a few shapes using python-pptx module in Python. I have got the shapes created however I am unable to edit the font color for the text inside shape. By default it displays in white color. I am trying to see how could I change…
dark horse
  • 447
  • 1
  • 6
  • 17
2
votes
1 answer

How to generate slides containing a chart defined on a PowerPoint Layout with Python?

I have a single layout that will be used to generate hundreds of slides displaying data contained on an Excel file. I've been able to write a macro with python-pptx (I'm not familiar with VBA) generating slides with the required text, using…
crocefisso
  • 793
  • 2
  • 14
  • 29
2
votes
1 answer

Reading embedded objects from presentation using python

I am working on python-pptx module. I have a presentation file which contains embedded files like(.pptx, .xlsx, .docx, .pdf) on slides. I need to read those files also while parsing the presentation. Is there any python-pptx attribute to read those…
Auro
  • 105
  • 1
  • 7
2
votes
3 answers

Importing python-pptx: ModuleNotFoundError: No module named 'pptx'

I'm running Python 3.6.6rc1 on macOS Mojave (10.14.1) and I'm trying to import python-pptx Currently, my first line is causing a problem: import python-pptx I deleted that and added this, to no avail. from pptx import Presentation This is my…
SanguineL
  • 1,189
  • 1
  • 7
  • 18
2
votes
1 answer

How to keep shape's position parameters in order to keep it's left-most side at given parameter "left",but not mid point?

While using python-pptx module, I came to know it places shape determining shape's center at given length in left parameter. Suppose I have given shape = slide.shapes.add_textbox(Inches(1), top, width, height) then shape's center point will be…
Karan Shah
  • 111
  • 11
2
votes
2 answers

Inserting comments in presentation using Python

I want to add some comments in presentation file for some text-boxes. Is there any python-pptx attribute available to do that ?
Auro
  • 105
  • 1
  • 7
2
votes
1 answer

Print Powerpoint slide with python-pptx

I've been using python-pptx to access slides (I find it much smoother than using win32 as it doesn't need to open the Powerpoint window. However, I've checked the docs but can't find any method of printing a slide. Am I missing something? Here is…
Neil
  • 706
  • 8
  • 23
2
votes
1 answer

To control the rounded angle of ROUNDED_RECTANGLE, python + pptx

When adding a ROUNDED_RECTANGLE on slides, by using pptx, I have below lines and a slide generated. from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE from pptx.util import Inches prs = Presentation() title_only_slide_layout =…
Mark K
  • 8,767
  • 14
  • 58
  • 118
2
votes
1 answer

creating a new pptx with python-pptx, and setting dimensions

I have a series of images that I want to consistently embed in a powerpoint document at the same position on the page. I can do the image import piece, but I need the powerpoint dimensions to be specifiable by the user. I think I can use the…
Jeff
  • 35
  • 1
  • 4
2
votes
1 answer

How to take save screenshot for each slide in pptx

How can I save screenshot for each slide in pptx when use python-pptx package. I have read python-pptx.readthedocs.io and find some tips maybe help, but still could not make it work.
Donghua Liu
  • 1,776
  • 2
  • 21
  • 30