powerpoint

Why can't Python open a pptx file?

Why can't Python open a pptx file? Question: I want Python to open a powerpont file. code: f=open(r”’C:UsersAsusOneDriveMáy tínhpythontest.pptx”’) print(f.read()) terminal: Traceback (most recent call last): File "c:UsersAsusOneDriveMáy tínhpythonhọc.py", line 16, in <module> print(f.read()) ^^^^^^^^ File "C:UsersAsusAppDataLocalProgramsPythonPython311Libencodingscp1258.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x8a in position 588: character …

Total answers: 1

convert plotly figure to image and then use this image as normal PNG

convert plotly figure to image and then use this image as normal PNG Question: I’m trying to convert a plotly express figure to image, then use this image to save it on a power point slide. This is my code: import plotly.express as px import plotly.io as pio from pptx import Presentation wide_df = px.data.medals_wide() …

Total answers: 1

Extracting Powerpoint background images using python-pptx

Extracting Powerpoint background images using python-pptx Question: I have several powerpoints that I need to shuffle through programmatically and extract images from. The images then need to be converted into OpenCV format for later processing/analysis. I have done this successfully for images in the pptx, using: for slide in presentation: for shape in slide.shapes if …

Total answers: 1

How to automate deletion of all text with Strikethrough formatting in a PowerPoint presentation?

How to automate deletion of all text with Strikethrough formatting in a PowerPoint presentation? Question: How can I automate the deletion of all text with Strikethrough formatting in a PowerPoint presentation? I found this useful link to do it in Excel: https://www.extendoffice.com/documents/excel/4831-excel-remove-delete-strikethrough-text.html I think something similar can probably be done for PowerPoint, but I have …

Total answers: 1

Python-pptx – How to insert a slide number for all slides

Python-pptx – How to insert a slide number for all slides Question: I am trying to automatically insert slide numbers to all my slides in PPT that is messy and strictly formatted. When we do manually,we are not able to do it for all the PPTs due to manual work involved. Is there anyway to …

Total answers: 1

python-pptx – How to replace keyword across multiple runs?

python-pptx – How to replace keyword across multiple runs? Question: I have two PPTs (File1.pptx and File2.pptx) in which I have the below 2 lines XX NOV 2021, Time: xx:xx – xx:xx hrs (90mins) FY21/22 / FY22/23 I wish to replace like below a) NOV 2021 as NOV 2022. b) FY21/22 / FY22/23 as FY21/22 …

Total answers: 1

python-pptx access table cell properties and apply it back during replace

python-pptx access table cell properties and apply it back during replace Question: I am trying to replace the table headers in powerpoint using python-pptx using the code below slides = [slide for slide in ip_ppt.slides] shapes = [] for slide in slides: for shape in slide.shapes: shapes.append(shape) def replace_text(replacements:dict,shapes:list): if shape.has_table: for row in shape.table.rows: …

Total answers: 2

Extract presenter notes from PPTx file (powerpoint)

Extract presenter notes from PPTx file (powerpoint) Question: Is there a solution in python or php that will allow me to get the presenter notes from each slide in a power point file? Thank you Asked By: Raven || Source Answers: You can use python-pptx. pip install python-pptx You can do the following to extract …

Total answers: 1

How to extract comments from PowerPoint presentation slides using Python

How to extract comments from PowerPoint presentation slides using Python Question: I need to extract comments (made using the Microsoft PowerPoint comment feature) from a series of PowerPoint presentations. The following link explains how to do it in C#: https://www.e-iceblue.com/Tutorials/Spire.Presentation/Spire.Presentation-Program-Guide/Comment-and-Note/Extract-comments-from-presentation-slides-and-save-in-txt-file.html It appears that python-pptx does not have the functionality to read/write comments from PowerPoint: https://python-pptx.readthedocs.io/en/latest/ …

Total answers: 3

Python pptx – part of text in cell with different color

Python pptx – part of text in cell with different color Question: I am using pptx module to generate slide with table. I am able to change font in each cell, but what I also need is change font of specific word in text. In example “Generating random sentence as example”. In this world “random” …

Total answers: 1