title: How to zip a folder in python with password?
body: <p>With pyminizip i am able to zip a file with password in python :</p>
  
  <pre><code>filepath=r"C:\Users\xxx\Desktop\myFolder\file.txt"
  
  import pyminizip
  pyminizip.compress(filepath, None,"output.zip", "password", 0)
  </code></pre>
  
  <p>But how do I zip the whole folder 'myFolder' into a zip file with password?
  I tried removing the filename from the path but it gives the error</p>
  
  <pre><code>OSError: error in opening C:\Users\xxx\Desktop\myFolder for reading
  </code></pre>
  
  <p>EDIT : </p>
  
  <p>The below link has a function which will zip the directory. But It wont add a password.</p>
  
  <p><a href="https://www.calazan.com/how-to-zip-an-entire-directory-with-python/" rel="nofollow noreferrer">https://www.calazan.com/how-to-zip-an-entire-directory-with-python/</a></p>
  
  <p>If anyone can let me know if it is possible to add a password to an existing zip file, that will solve my problem. Is that possible?</p>