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 set title to a powerpoint slide using win32com client

Could anyone please help me in setting a title to a powerpoint slide using win32com library in Python. The following is the code. I have used the slide layout 11 which denotes Title only import openpyxl as op import pptx import os import…
amt1906
  • 75
  • 3
  • 10
0
votes
2 answers

How to Delete Power Point Slide Using specific String in python?

How to delete a power point slide by finding a specific string character in python? I have a string named "abc".Now if this string is available in any slide then that slide will delete automatically. How to resolve this issue as I am a total…
Shaon
  • 133
  • 1
  • 13
0
votes
2 answers

ImportError with python-pptx

I faced with problem when I installed python-pptx with conda on cleaned environment: conda install -c conda-forge python-pptx. After install was successfully finished I tried to import pptx module and got following error: >>> import pptx Traceback…
EugenS
  • 83
  • 11
0
votes
1 answer

How to assign Macro using python-pptx

How could i assign a macro to a shape while being added using python pptx Titleleft = Cm(25.37) # 0.93" centers this overall set of shapes Titleltop = Cm(14.56) Titlelwidth = Cm(2.89) Titlelheight = Cm(0.64 ) txBox =…
0
votes
5 answers

How Could I replace Text in a PPP with Python pptx?

I want to replace the text in a textbox in Powerpoint with Python-pptx. Everything I found online didn't work for me and the documentation isn't that helpful for me. So I have a Textbox with the Text: $$Name 1$$ $$Name 2$$ and I want to change…
haelbito
  • 1
  • 1
  • 1
0
votes
1 answer

How to update data in pptx file in python

Update data pptx file in python using python-pptx lib If anybody have code please share from pptx import Presentation import Image prs = Presentation('SamplePowerpoint.pptx') try: from PIL import Image except ImportError: import Image
Anil Yadav
  • 241
  • 4
  • 15
0
votes
1 answer

python-pptx: change border width for pie chart

Is it possible to set/edit a Pie chart's border width in python-pptx? I'd image something like this would do the trick? for idx, point in enumerate(chart.series[0].points): point.format.width = Pt(7.25)
Boosted_d16
  • 13,340
  • 35
  • 98
  • 158
0
votes
0 answers

Python-pptx image file volumn

I try to make pptx file to python. Main task is load many picture(.tif .jpg) in pptx. Here is code prs = Presentation() current_slide = prs.slides.add_slide(prs.slide_layouts[0]) pic = current_slide.shapes.add_picture(img_path,…
엄승탁
  • 15
  • 1
  • 4
0
votes
3 answers

How remove axis lines in clustered bar chart using python-pptx?

This is the sample code that I have to produce the chart (image linked below). x, y, cx, cy = Inches(2), Inches(2), Inches(6), Inches(4.5) graphic_frame = slide.shapes.add_chart( XL_CHART_TYPE.BAR_CLUSTERED, x, y, cx, cy, chart_data ) chart =…
0
votes
2 answers

How to give a chart a title with iterator value in a loop?

I would like to add a title (from a list titles) to each of my charts in a loop, but the loop is failing when I try to add a text box to the chart (with iterator). Are iterator values allowed to serve as titles for charts? I'm using Python 3.6. Any…
SoSincere3
  • 117
  • 1
  • 10
0
votes
1 answer

Selection of any PPT file globally Using VBA

I have created a code which select a PPT file from my system. But this is a hard code. How can I create a global code instead of hardcoding? My code is given below: Sub PPTTest() Dim PPT As Object Set PPT =…
Shaon
  • 133
  • 1
  • 13
0
votes
0 answers

Using pptx without having to first save outputs to jpg files

I am creating a powerpoint in Python, where the slides are the output graphs from the Jupyter Notebook cells. I am able to do this, but only if I save each output as a jpg. For example, see the code below: data = pd.read_csv("123.csv") data.columns…
MRHarv
  • 491
  • 1
  • 10
  • 22
0
votes
3 answers

python-pptx: read font color

I want to read the font color from a given textbox. I can extract font name and bold but not color (or font name). Here's my code: text_frame = shape.text_frame paragraph = text_frame.paragraphs[0] for run in paragraph.runs: font = run.font …
Boosted_d16
  • 13,340
  • 35
  • 98
  • 158
0
votes
0 answers

Calculating table row height dynamically

We need to generate a report using a template. Some slides contain tables, where the data will be pulled from data sources and write it to the table cells, finally save the report with a new name. While writing to table cells, we need to write it…
Lokesh Sanapalli
  • 1,012
  • 3
  • 18
  • 39
0
votes
3 answers

Python - Trying to call a function from another file (using python-pptx)

I have a build a Python script that uses python-pptx module to generate a powerpoint deck. The code runs over 300 lines of code due to various formatting. So I plan to split into several sub-functions so that it is easy to maintain in future. Given…
hello kee
  • 289
  • 2
  • 6
  • 17