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

Is there a way to change the color of all of the cells in a table in py pptx?

I know that there is a way to change the color of one individual cell in a table by naming that cell from that table and then coloring that cell; however I'm looking for a way to change the color of all cells in one table at the same time. The table…
KingT753
  • 81
  • 1
  • 5
0
votes
2 answers

Is there a way to "Switch row/column" data in a chart?

I am creating a chart and want to switch the rows and columns of the data that I have input before opening the chart in PowerPoint. The series gets formatted and grouped incorrectly and the chart means nothing in this way. I am using tuples which I…
KingT753
  • 81
  • 1
  • 5
0
votes
1 answer

Can ComboBox or ListBox controls be maniputed with python-pptx

I would like to distribute a pptx file with a Python script that adds customized graphs using python-pptx. To customize the graphs, I would like to have a slide that acts as a form to allow users to set some values. I can add combobox's and…
JGlazer
  • 3
  • 2
0
votes
2 answers

run.font.italic and run.font.bold return None instead of True

I need to get all text that is italic and bold in paragraphs. I am manually turning text into italic and bold form but the code below returns none. Is it only an initiator or can we get the value out of it as well, how can I get all italic and bold…
Rami.K
  • 189
  • 2
  • 11
0
votes
2 answers

MSO_CONNECT not being detected. Getting number of lines on a slide?

I need to get the number of lines on a slide. To access the lines, I am using MSO_CONNECTOR as it is not an AUTO_SHAPE. However when I run the below it returns an None value for some reason. How can I know if a shape is a line or not? (tried using…
Rami.K
  • 189
  • 2
  • 11
0
votes
1 answer

Sort PowerPoint chart data with Python?

I am sourcing chart data from an excel spreadsheet, by using Openpyxl. I need to be able to sort this data largest to smallest without it getting jumbled. Sometimes there are multiple series in the charts. Is there a method by which this can be…
emmartin
  • 105
  • 12
0
votes
1 answer

Fit a Picture in PPT Placeholder

I want to fit an image in PPT placeholder and looked two below links: Similar Question Similar Query From the similar question, I have applied the solution but it is still showing cropped image in the ppt. My code for the same: prs =…
Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
0
votes
1 answer

restrict table dimensions to the table placeholder dimensions in python-pptx

i am trying to add a table to a presentation using python-pptx with a specific dimensions i created a slide layout from power-point which contains the table placeholder in the area i want and loaded it using python-pptx. slide_layout but regardless…
0
votes
1 answer

loop through function parameters to create power point presentaion

I am trying to define function to generate a power point presentation by python-pptx. I have my own power point template and multiple images needed to be embedded into each slide. I used * to allow arbitrary number of arguments to functions. For…
0
votes
0 answers

ModuleNotFoundError: No module named 'pptx'

I am using windows and have anaconda installed. I pip installed python-pptx. and I can see it at the same location where my numpy, pandas, seaborn and other libraries are. All other libraries are working in jupyter notebook except this. This the…
Kopal Sharma
  • 69
  • 1
  • 2
  • 10
0
votes
1 answer

Color tables cells in ppt using python

So I have a excel which contains a table like this: I want to get the same table in powerpoint using Python Work Done till now: Read the excel to python and store in pandas df Add df to powerpoint Code for the same effort: from pd2ppt import…
Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
0
votes
0 answers

How to read individual slide from ppt using tika package in python?

I want to compare data in two pptx file and show the differences if any using python. I have tried with below code, but it is giving all content in single file. No way to segregate data based on slides. I am able to read all content of pptx using…
0
votes
1 answer

Get Table and Title in one Slide

I have below code which generates a sample side with layout 1 with Title as Summary Table from pd2ppt import df_to_powerpoint from pd2ppt import df_to_table import pandas as pd from pptx import Presentation from pptx.util import Inches path…
Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
0
votes
0 answers

Can't save python pptx file

I manipulate an existing pptx file with python-pptx. Somehow I can't save my changes in the file. The manipulation works out well. To give an example: I can change the values in a table and when I read out the table I receive the new values. At the…
j. DOE
  • 238
  • 1
  • 2
  • 15
0
votes
1 answer

How to read the footers from the slides and store it as String

I want to read all the footers from a ppt using python (python-pptx) and store it in different Strings. The documentation is not of much help. Can anyone help me with this? >> slide_placeholders = slide.placeholders >>…