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

Method save

src/pptx/opc/package.py:151–156  ·  view source on GitHub ↗

Save this package to `pkg_file`. `file` can be either a path to a file (a string) or a file-like object.

(self, pkg_file: str | IO[bytes])

Source from the content-addressed store, hash-verified

149 raise Exception("ProgrammingError: ran out of candidate_partnames") # pragma: no cover
150
151 def save(self, pkg_file: str | IO[bytes]) -> None:
152 """Save this package to `pkg_file`.
153
154 `file` can be either a path to a file (a string) or a file-like object.
155 """
156 PackageWriter.write(pkg_file, self._rels, tuple(self.iter_parts()))
157
158 def _load(self) -> Self:
159 """Return the package after loading all parts and relationships."""

Calls 2

iter_partsMethod · 0.95
writeMethod · 0.45