How to save created Zip file to file system in python?
<p>Using python zipfile module I created a zip file as follows:</p>

<pre><code>s = StringIO()
zip_file = zipfile.ZipFile(s, "w")
zip_file.write('/local/my_files/my_file.txt')
s.seek(0)
</code></pre>

<p>and now, I want this <code>zip_file</code> to be saved in my file system at path <code>/local/my_files/</code> as <code>my_file.zip</code>. 
Generally to save a noraml files I used the following flow:</p>

<pre><code>with open(dest_file, 'w') as out_file:
    for line in in_file:
        out_file.write(line)
</code></pre>

<p>But, I think I can't achieve saving a zipfile with this. Can any one please help me in getting this done.</p>