Go до строки в Python PPTX TextBox - PullRequest
0 голосов
/ 26 мая 2020

Я создаю текстовое поле с библиотекой Python -pptx со следующим кодом:

def changeFont(text_frame, size, font, text, R,G,B):
    #next two lines are for make text centre
    p = text_frame.paragraphs[0]
    text_frame.paragraphs[0].alignment=PP_ALIGN.CENTER
    run = p.add_run()
    #this line is for set text
    run.text =str(text)
    font = run.font
    #this line gives font to text
    font.name = str(font)
    #this line gives size for font
    font.size = Pt(int(size))
    #this line makes text bold
    font.bold = True
    font.italic = None  # cause value to be inherited from theme
    #next two lines are for givving some color for text
    font.color.theme_color = MSO_THEME_COLOR.ACCENT_1
    font.color.rgb = RGBColor(int(R), int(G), int(B))

txBoxWords = slide.shapes.add_textbox(10, prs.slide_height-Inches(1), prs.slide_width, 2)
text_frame = txBoxWords.text_frame
words = ["word1", "word2", "word3", "word4"]
words = " ".join(words).upper()
changeFont(text_frame, 18, "Calibri", words, 0, 0, 0)

Как мне go перейти к строке после слова 2 в моем текстовом поле?

...