powerpoint

python-pptx – How to individually hide/show data labels in graph

python-pptx – How to individually hide/show data labels in graph Question: I would like to be able to flexibly show or hide data labels in a stacked bar chart. I thought this would have been possible by accessing an individual datalabel as such: plot.series[0].points[1].data_label and then assigning its has_text_frame attribute to True or False, but …

Total answers: 2

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

run.font.italic and run.font.bold return None instead of True Question: 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 …

Total answers: 2

python-pptx: Getting odd splits when extracting text from slides

python-pptx: Getting odd splits when extracting text from slides Question: I’m using the “Extract all text from slides in presentation” example at https://python-pptx.readthedocs.io/en/latest/user/quickstart.html to extract text from some PowerPoint slides. from pptx import Presentation prs = Presentation(path_to_presentation) # text_runs will be populated with a list of strings, # one for each text run in presentation …

Total answers: 2

Python-PPTX: Changing table style or adding borders to cells

Python-PPTX: Changing table style or adding borders to cells Question: I’ve started putting together some code to take Pandas data and put it into a PowerPoint slide. The template I’m using defaults to Medium Style 2 – Accent 1 which would be fine as changing the font and background are fairly easy, but there doesn’t …

Total answers: 3

Export chart as image with python xlwings

Export chart as image with python xlwings Question: I have been working on creating Excel reports automatically using Python and xlwings. Within these reports there are multiple charts and graphs which I now want to use in a pptx presentation keeping the same formatting and design. For the generation of the pptx I am currently …

Total answers: 2

Python pptx (Power Point) Find and replace text (ctrl + H)

Python pptx (Power Point) Find and replace text (ctrl + H) Question: Question in Short: How can I use the find and replace option (Ctrl+H) using the Python-pptx module? Example Code: from pptx import Presentation nameOfFile = “NewPowerPoint.pptx” #Replace this with: path name on your computer + name of the new file. def open_PowerPoint_Presentation(oldFileName, newFileName): …

Total answers: 8

How to convert a .pptx to .pdf using Python

How to convert a .pptx to .pdf using Python Question: I have been looking to convert a .pptx file to a .pdf file through a Python script for several hours but nothing seems to be working. What I have tried: I have tried 1) this script which calls windows32.client, and 2) unoconv, but none of …

Total answers: 8

Read From PowerPoint Table in Python?

Read From PowerPoint Table in Python? Question: I am using the python pptx module to automatically update values in a powerpoint file. I am able to extract all the text in the file using the code below: from pptx import Presentation prs = Presentation(path_to_presentation) # text_runs will be populated with a list of strings, # …

Total answers: 3