Open jaakkor2 opened 4 years ago
This works
using PyCall
pptx = pyimport("pptx")
RGBColor = pptx.dml.color.RGBColor
Inches = pptx.util.Inches
prs = pptx.Presentation()
title_slide_layout = get(prs.slide_layouts, 1)
slide = prs.slides.add_slide(title_slide_layout)
shape = slide.shapes.add_table(4, 3, Inches(1), Inches(1), Inches(3), Inches(2))
shape.table.cell(1,1).fill.solid()
py"""
$shape.table.cell(1,1).fill.fore_color.rgb = $RGBColor(255, 0, 0)
"""
prs.save("debug_rgb_jl.pptx")
Similar problem with openpyxl where some part of the code has to be wrapped inside py""" ... """
in https://discourse.julialang.org/t/julia-using-openpyxl-to-change-column-width-row-height/45172/5 .
Installed python-pptx like this
In this example, the second last line fails, since
ERROR: KeyError: key "rgb" not found
.For some reason
shape.table.cell(1,1).fill.fore_color.type
isnothing
. whereas in the Python version it is1
. Here is Python version of the aboveAlso, in Julia, typing
shape.<TAB>
results inError: Error in the keymap...
.Julia v1.2, Conda v1.3.0, PyCall v1.91.2.