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

python-pptx -- Trying to insert a number into a table as type integer and not string

I am trying to insert some numbers into a powerpoint deck using the python-pptx module. I have been able to insert values by converting all numbers to string as shown below. Could anyone advice if we can directly insert a number as an integer or…
hello kee
  • 289
  • 2
  • 6
  • 17
0
votes
1 answer

How to access the shape element of slides when trying to get placeholder details? This is done using Python PPTX

I am writing a code to find out the number of placeholders present in an existing PowerPoint presentation. But for some reason i am unable to load the side values to shape. I am missing something here. Could someone guide me? I read the…
CN Gokul
  • 3
  • 3
0
votes
1 answer

Python pptx - Editing excel spreadsheet table (no linked table or outside workbook required)

In PowerPoint, I have Inserted an Excel Spreadsheet table, but the "table" only seems to be a graphicframe without a shape type and returns false when I check for a table or chart: from pptx import Presentation prs =…
newtothis
  • 35
  • 10
0
votes
1 answer

python-pptx - How to increase line chart area

I am trying to see if we can increase the chart area of a line chart created using python-pptx Referring to the below sample, I am trying to see how can I increase the width of the line chart chart_data = ChartData() chart_data.categories = ['Q1…
hello kee
  • 289
  • 2
  • 6
  • 17
0
votes
3 answers

python-pptx having a problem with fit_text()

I'm trying to call fit_text() on a textbox, but I keep getting this error: 'NoneType' object is not iterable from this line python3.6/site-packages/pptx/text/layout.py in _wrap_lines, line 112 which is text, remainder =…
Saleh
  • 173
  • 2
  • 12
0
votes
1 answer

Convert shape in powerpoint to image and save

I have a Powerpoint presentation with images. On each of the image is a straight line (connector) and a circle drawn by hand (shape). [medical image with highlited features] My goal is to extract image, line and the circle as a separate pictures…
HonzaB
  • 7,065
  • 6
  • 31
  • 42
0
votes
1 answer

Python pptx Click action examples

i'm trying to recreate a simple PP_Action. The code below built without errors however the click action will not run in the slides. 'shape.click_action.action' returns with NONE(0) after action is being assigned. Is there anything wrong with the…
Joel Hiou
  • 1
  • 1
0
votes
0 answers

Images getting corrupted after running python pptx code

I am trying to insert some images on slides. But after I run the code, the the images are getting corrupted and a message would appear. I have pasted the message here.: The code which i am using…
Manoj Kumar
  • 176
  • 7
0
votes
1 answer

Python-pptx loading slide content from csv

Looking to insert text, images, etc. from a CSV file into a PowerPoint presentation using Python-pptx. So the idea is each line in a CSV would have title, text, image that I could update then run Python-pptx to pull from the CSV to populate each…
jhblake
  • 1
  • 2
0
votes
1 answer

How to set marker color in XL_CHART_TYPE.LINE_MARKERS

How to set marker color (line, and body of marker) when using XL_CHART_TYPE.LINE_MARKERS? Tricks like chart.plots[0].series[0].marker.fill.fore_color = pptx.dml.color.RGBColor(0,0,0) don't work Below an sample of code: import traceback import…
EugenS
  • 83
  • 11
0
votes
1 answer

How to set column colors and distance in chart

1)How I can to set color for each series in column chart as posted below? 2) do exist a way to set distance between columns and their width? Below an sample of code from pptx import Presentation from pptx.chart.data import ChartData from…
EugenS
  • 83
  • 11
0
votes
0 answers

xpath Python : Series data is not saving permanently in PPT

I am trying to change the PPT bar chart series data and for that I am changing the xml of PPT using Python. I am iterating over chart series and I am able to change these data Something like below. ser.xpath('./c:cat//c:pt/c:v')[1].text = "Some…
J Doe
  • 112
  • 7
0
votes
1 answer

AttributeError when loading pptx module in Python

I get the reoccuring AttributeError when trying to import the python-pptx module: import pptx AttributeError Traceback (most recent call last) ... ----> 8 import pptx.exc as exceptions ... AttributeError: module 'pptx'…
Jones1220
  • 786
  • 2
  • 11
  • 22
0
votes
1 answer

HOW TO Ungroup chartdata with time-dependent values in python-pptx

I tried to output XYdata with Date-type category axis (datetime.datetime objects along X-axis). I need to view all data points (X,Y) that are contained in chart_data. But, unfortunatelly, they appear grouped by year in presentation. How can I change…
EugenS
  • 83
  • 11
0
votes
1 answer

Python-pptx on AppEngine

I need to be able to create and download presentations using Django Python. I also need to use AppEngine standard. Currently I am using python-pptx but according to this SO answer it wont work. I get cannot import name etree or 'module' object has…