from pptx import Presentation
prs=Presentation("/tmp/sesion_bni.pptx")
slide=prs.slides[112]
for shape in slide.shapes:
 if not shape.has_table:continue
 t=shape.table;nr=len(list(t.rows));nc=len(t.columns)
 for ri in range(1,nr-1):
  for ci in range(nc):
   s=t.cell(ri+1,ci);d=t.cell(ri,ci);d.text=""
   dp=d.text_frame.paragraphs[0]
   for sr in s.text_frame.paragraphs[0].runs:
    dr=dp.add_run();dr.text=sr.text
    if sr.font.size:dr.font.size=sr.font.size
    if sr.font.name:dr.font.name=sr.font.name
 nd=["05 de Mayo","Miguel Varela","Silvia Burkle","21 de Abril"]
 for ci in range(nc):
  dc=t.cell(nr-1,ci);rc=t.cell(nr-2,ci);dc.text=""
  dp=dc.text_frame.paragraphs[0];dr=dp.add_run();dr.text=nd[ci]
  rr=rc.text_frame.paragraphs[0].runs
  if rr:
   if rr[0].font.size:dr.font.size=rr[0].font.size
   if rr[0].font.name:dr.font.name=rr[0].font.name
 break
prs.save("/tmp/out.pptx")
print("Saved!")
p2=Presentation("/tmp/out.pptx")
for s in p2.slides[112].shapes:
 if s.has_table:
  for ri,row in enumerate(s.table.rows):
   print(f"Row {ri}: {[c.text.strip() for c in row.cells]}")
