title: How to exclude ".DS_Store" path when compressing files in Python
body: <p>I have a python script that compresses specific files into a zip file. However I have noticed that a file ".DS_Store" is produced within this zip file. Is there a way I can remove this from the zip file or avoid it being created in the first place in my python script. From what I have found online I think on a windows machine this hidden file appears as "macosx" file.</p>
  
  <p>I've tested the zip file with and without the ".DS_Store" hidden file (I manually deleted it). When I remove it, the zip file is able to be processed correctly and when I leave it in, errors are thrown.</p>
  
  <p>This is how I create the zip file in my python script:</p>
  
  <pre><code>    #Create zip file of all necessary files
      zipf = zipfile.ZipFile(new_path+zip_file_name, 'w', zipfile.ZIP_DEFLATED)
      create_zip(new_path,zipf)
      zipf.close()
  </code></pre>
  
  <p>Any advice how to approach removing this hidden file would be appreciated.</p>