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

Method add_text

src/docx/text/run.py:88–96  ·  view source on GitHub ↗

Returns a newly appended |_Text| object (corresponding to a new `` `` child element) to the run, containing `text`. Compare with the possibly more friendly approach of assigning text to the :attr:`Run.text` property.

(self, text: str)

Source from the content-addressed store, hash-verified

86 self._r.add_tab()
87
88 def add_text(self, text: str):
89 """Returns a newly appended |_Text| object (corresponding to a new ``<w:t>``
90 child element) to the run, containing `text`.
91
92 Compare with the possibly more friendly approach of assigning text to the
93 :attr:`Run.text` property.
94 """
95 t = self._r.add_t(text)
96 return _Text(t)
97
98 @property
99 def bold(self) -> bool | None:

Callers 2

it_can_add_textMethod · 0.95

Calls 2

_TextClass · 0.85
add_tMethod · 0.80

Tested by 1

it_can_add_textMethod · 0.76