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

Method text

src/pptx/text/text.py:153–170  ·  view source on GitHub ↗

All text in this text-frame as a single string. Read/write. The return value contains all text in this text-frame. A line-feed character (`"\\n"`) separates the text for each paragraph. A vertical-tab character (`"\\v"`) appears for each line break (aka. soft carriage-return

(self)

Source from the content-addressed store, hash-verified

151
152 @property
153 def text(self) -> str:
154 """All text in this text-frame as a single string.
155
156 Read/write. The return value contains all text in this text-frame. A line-feed character
157 (`"\\n"`) separates the text for each paragraph. A vertical-tab character (`"\\v"`) appears
158 for each line break (aka. soft carriage-return) encountered.
159
160 The vertical-tab character is how PowerPoint represents a soft carriage return in clipboard
161 text, which is why that encoding was chosen.
162
163 Assignment replaces all text in the text frame. A new paragraph is added for each line-feed
164 character (`"\\n"`) encountered. A line-break (soft carriage-return) is inserted for each
165 vertical-tab character (`"\\v"`) encountered.
166
167 Any control character other than newline, tab, or vertical-tab are escaped as plain-text
168 like "_x001B_" (for ESC (ASCII 32) in this example).
169 """
170 return "\n".join(paragraph.text for paragraph in self.paragraphs)
171
172 @text.setter
173 def text(self, text: str):

Callers

nothing calls this directly

Calls 3

clear_contentMethod · 0.80
splitMethod · 0.80
append_textMethod · 0.80

Tested by

no test coverage detected