PPT PPTX ODP POT ppsx
Aspose.Slides  for Python via .NET
PPTX

Lock or Password Protect PPTX using Python

Build your own Python apps to protect presentation files using server-side APIs.

Protecting a PPTX Presentation via Python

Using Aspose.Slides for Python via .NET, you can protect your PPTX presentation from opening or modification by setting a password. Then, to open or modify the locked presentation, a user has to provide the password.

Encrypting a PPTX Presentation using Python


import aspose.slides as slides

with slides.Presentation("pres.pptx") as pres:
    pres.protection_manager.encrypt("123123")
    pres.save("encrypted-pres.pptx", slides.export.SaveFormat.PPTX)

Setting Write Protection to a PPTX Presentation using Python


import aspose.slides as slides

with slides.Presentation("pres.pptx") as pres:
    pres.protection_manager.set_write_protection("123123")
    pres.save("write-protected-pres.pptx", slides.export.SaveFormat.PPTX)

How to Password Protect PPTX via Python

These are the steps to Protect PPTX files.

  1. Load PPTX with an instance of Presentation

  2. Protect the presentation using ProtectionManager class

  3. Save result in PPTX format

Other Supported Protect Formats

Using Python, You can also protect the following formats: