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

Method clear_content

src/pptx/oxml/text.py:93–99  ·  view source on GitHub ↗

Remove all `a:p` children, but leave any others. cf. lxml `_Element.clear()` method which removes all children.

(self)

Source from the content-addressed store, hash-verified

91 p: CT_TextParagraph = OneOrMore("a:p") # pyright: ignore[reportAssignmentType]
92
93 def clear_content(self):
94 """Remove all `a:p` children, but leave any others.
95
96 cf. lxml `_Element.clear()` method which removes all children.
97 """
98 for p in self.p_lst:
99 self.remove(p)
100
101 @property
102 def defRPr(self) -> CT_TextCharacterProperties:

Callers 2

textMethod · 0.80
append_ps_fromMethod · 0.80

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected