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 -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -