<tfoot id='oMhij'></tfoot>
      <bdo id='oMhij'></bdo><ul id='oMhij'></ul>

    <i id='oMhij'><tr id='oMhij'><dt id='oMhij'><q id='oMhij'><span id='oMhij'><b id='oMhij'><form id='oMhij'><ins id='oMhij'></ins><ul id='oMhij'></ul><sub id='oMhij'></sub></form><legend id='oMhij'></legend><bdo id='oMhij'><pre id='oMhij'><center id='oMhij'></center></pre></bdo></b><th id='oMhij'></th></span></q></dt></tr></i><div id='oMhij'><tfoot id='oMhij'></tfoot><dl id='oMhij'><fieldset id='oMhij'></fieldset></dl></div>

    1. <legend id='oMhij'><style id='oMhij'><dir id='oMhij'><q id='oMhij'></q></dir></style></legend>

        <small id='oMhij'></small><noframes id='oMhij'>

        如何创建加密的ZIP文件?

        时间:2024-08-10
              <tbody id='slTfY'></tbody>
              <bdo id='slTfY'></bdo><ul id='slTfY'></ul>
              1. <i id='slTfY'><tr id='slTfY'><dt id='slTfY'><q id='slTfY'><span id='slTfY'><b id='slTfY'><form id='slTfY'><ins id='slTfY'></ins><ul id='slTfY'></ul><sub id='slTfY'></sub></form><legend id='slTfY'></legend><bdo id='slTfY'><pre id='slTfY'><center id='slTfY'></center></pre></bdo></b><th id='slTfY'></th></span></q></dt></tr></i><div id='slTfY'><tfoot id='slTfY'></tfoot><dl id='slTfY'><fieldset id='slTfY'></fieldset></dl></div>

                <small id='slTfY'></small><noframes id='slTfY'>

                <tfoot id='slTfY'></tfoot>

              2. <legend id='slTfY'><style id='slTfY'><dir id='slTfY'><q id='slTfY'></q></dir></style></legend>

                  本文介绍了如何创建加密的ZIP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在Python2.5中使用ZipFile创建ZIP文件,目前工作正常:

                  import zipfile, os
                  
                  locfile = "test.txt"
                  loczip = os.path.splitext (locfile)[0] + ".zip"
                  zip = zipfile.ZipFile (loczip, "w")
                  zip.write (locfile)
                  zip.close()
                  

                  但我找不到如何加密ZIP文件中的文件。 我可以使用system并调用PKZIP -s,但我想一定有更多的方法。我正在寻找开源解决方案。

                  推荐答案

                  我创建了一个简单的库来用Python语言创建密码加密的压缩文件。-here

                  import pyminizip
                  
                  compression_level = 5 # 1-9
                  pyminizip.compress("src.txt", "dst.zip", "password", compression_level)
                  

                  该库需要zlib。

                  我已检查该文件可以在WINDOWS/MAC中解压。

                  这篇关于如何创建加密的ZIP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:用于使用窗体身份验证绕过警报消息的scrapy 下一篇:解压缩文件而不创建临时文件

                  相关文章

                • <small id='SmOeR'></small><noframes id='SmOeR'>

                    1. <tfoot id='SmOeR'></tfoot>

                      <i id='SmOeR'><tr id='SmOeR'><dt id='SmOeR'><q id='SmOeR'><span id='SmOeR'><b id='SmOeR'><form id='SmOeR'><ins id='SmOeR'></ins><ul id='SmOeR'></ul><sub id='SmOeR'></sub></form><legend id='SmOeR'></legend><bdo id='SmOeR'><pre id='SmOeR'><center id='SmOeR'></center></pre></bdo></b><th id='SmOeR'></th></span></q></dt></tr></i><div id='SmOeR'><tfoot id='SmOeR'></tfoot><dl id='SmOeR'><fieldset id='SmOeR'></fieldset></dl></div>

                      • <bdo id='SmOeR'></bdo><ul id='SmOeR'></ul>

                      <legend id='SmOeR'><style id='SmOeR'><dir id='SmOeR'><q id='SmOeR'></q></dir></style></legend>