puthon中zipfile设置密码问题
设置密码总是报错,不设置密码是ok的import zipfile
pwd=bytes('123456',encoding="utf8")
zipfile.ZipFile.setpassword(pwd)
f=zipfile.ZipFile("archive.zip","w",zipfile.ZIP_DEFLATED)
#要压缩的文件
f.write("a.txt")
f.close()
刚看了下官方文档,zipfile supports description of encrypted files in ZIP archives,but it currently cannot create an encrypted file
页:
[1]