python pptx - check if object is a table, textbox or image -


i use python 2.7 python pptx,

i need build general function center objects in slide.

i know how center individual object type (textbox, table, image etc.) , need build function tell type of object given object , allign properley.

i need similar to:

if foo bar  

condition.

i found table general object here enter link description here , used following code:

    if table pptx.shapes.graphfrm.graphicframe.table:         print "what" 

it not work,

how can check if object type of pptx object

thanks!

the actual objects can appear on slide shapes. visually, there might items "show through" slide master or layout, logo instance, object standpoint, slide contains shapes , that's it.

so objects "on" slide in slide.shapes, , can identify type of each 1 using shape.shape_type. 1 of values in mso_shape_type enumeration, of table one.

this code enumerate shape types on given slide:

for shape in slide.shapes:     print(shape.shape_type) 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -