title: How do i zip files in python without all directories written to it
body: <p>Im trying to zip multible files but i have run into a strange problem when i opened the zip file all directories leading to the files are listed as well
  <code>home/site/Uploads/test/</code></p>
  
  <p>Here is the python code i have written </p>
  
  <pre><code>import os
  import zipfile
  
  zf = zipfile.ZipFile("myzipfile.zip", "w")
  for dirname, subdirs, files in os.walk("D:/home/site/Uploads/test/"):
  zf.write(dirname)
  for filename in files:
      zf.write(os.path.join(dirname, filename))
  zf.close()
  </code></pre>
  
  <p>The zipped files are fine but why is every other directory listed too.</p>
  
  <p>I got the zip file like this
  -->home-->site-->Uploads-->test-->file.txt
  what i wanted was this
  -->file.txt</p>