I am creating an ZIP file with ZipFileZipFile
in Python 2.5, it works okOK so far:
import zipfile, os
locfile = "test.txt"
loczip = os.path.splitext (locfile)[0] + ".zip"
zip = zipfile.ZipFile (loczip, "w")
zip.write (locfile)
zip.close()
butBut I couldn't find how to encrypt the files in the ZIP file.
I could use system and call PKZIP -sPKZIP -s
, but I suppose there must be a more "Pythonic" way. I'm looking for an open source solution.