MCPcopy Create free account
hub / github.com/scanny/python-pptx / text

Method text

src/pptx/text/text.py:593–611  ·  view source on GitHub ↗

Text of paragraph as a single string. Read/write. This value is formed by concatenating the text in each run and field making up the paragraph, adding a vertical-tab character (`"\\v"`) for each line-break element (` `, soft carriage-return) encountered. While

(self)

Source from the content-addressed store, hash-verified

591
592 @property
593 def text(self) -> str:
594 """Text of paragraph as a single string.
595
596 Read/write. This value is formed by concatenating the text in each run and field making up
597 the paragraph, adding a vertical-tab character (`"\\v"`) for each line-break element
598 (`<a:br>`, soft carriage-return) encountered.
599
600 While the encoding of line-breaks as a vertical tab might be surprising at first, doing so
601 is consistent with PowerPoint&#x27;s clipboard copy behavior and allows a line-break to be
602 distinguished from a paragraph boundary within the str return value.
603
604 Assignment causes all content in the paragraph to be replaced. Each vertical-tab character
605 (`"\\v"`) in the assigned str is translated to a line-break, as is each line-feed
606 character (`"\\n"`). Contrast behavior of line-feed character in `TextFrame.text` setter.
607 If line-feed characters are intended to produce new paragraphs, use `TextFrame.text`
608 instead. Any other control characters in the assigned string are escaped as a hex
609 representation like "_x001B_" (for ESC (ASCII 27) in this example).
610 """
611 return "".join(elm.text for elm in self._element.content_children)
612
613 @text.setter
614 def text(self, text: str):

Callers

nothing calls this directly

Calls 2

clearMethod · 0.95
append_textMethod · 0.80

Tested by

no test coverage detected