<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文件?

        How to create an encrypted ZIP file?(如何创建加密的ZIP文件?)
              <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文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  GUI Freezes while downloading PyQt5 and Pytube(GUI在下载PyQt5和Pytube时冻结)
                  How to solve memory issues while multiprocessing using Pool.map()?(如何解决使用Pool.map()进行多处理时的内存问题?)
                  Python - How to use FastAPI and uvicorn.run without blocking the thread?(Python-如何使用FastAPI和uvicorn.run而不阻塞线程?)
                  How to increment a shared counter from multiple processes?(如何从多个进程递增共享计数器?)
                  Using pika, how to connect to rabbitmq running in docker, started with docker-compose with external network?(使用pika,如何连接运行在docker中的rabbitmq,从docker开始-与外部网络连接?)
                  How to use .rolling() on each row of a Pandas dataframe?(如何对 pandas 数据帧的每一行使用.roll()?)
                  • <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>
                              <tbody id='SmOeR'></tbody>

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