MCPcopy Index your code
hub / github.com/python-openxml/python-docx / add_t

Method add_t

src/docx/oxml/text/run.py:40–45  ·  view source on GitHub ↗

Return a newly added ` ` element containing `text`.

(self, text: str)

Source from the content-addressed store, hash-verified

38 tab = ZeroOrMore("w:tab")
39
40 def add_t(self, text: str) -> CT_Text:
41 """Return a newly added `<w:t>` element containing `text`."""
42 t = self._add_t(text=text)
43 if len(text.strip()) < len(text):
44 t.set(qn("xml:space"), "preserve")
45 return t
46
47 def add_drawing(self, inline_or_anchor: CT_Inline | CT_Anchor) -> CT_Drawing:
48 """Return newly appended `CT_Drawing` (`w:drawing`) child element.

Callers 3

add_textMethod · 0.80
flushMethod · 0.80

Calls 1

qnFunction · 0.90