passwords - How do I setpassword to compressed zip files in Python -


i error when try set password zip file. below code/error get. please give me example of correct way it.

  • this password part of script... entire script long post.

code:

password = "dog"  password = zipfile.setpassword(pwd)  error received when hitting password part of script. ------------------------------------------- traceback (most recent call last):   file "c:\users\owner\desktop\zip-it\zip it.py", line 86, in <module>     start()   file "c:\users\owner\desktop\zip-it\zip it.py", line 54, in start     compress()   file "c:\users\owner\desktop\zip-it\zip it.py", line 70, in compress     password = zipfile.setpassword(pwd) attributeerror: 'module' object has no attribute 'setpassword' 

are running python 2.6+?


zipfile.setpassword(pwd)

set pwd default password extract encrypted files.

new in version 2.6.


the python zipfile docs @ top "[support] decryption of encrypted files in zip archives, cannot create encrypted file."


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -