Hi,
There's a similar thread here but it's sort of left unanswered: Adding extra files to a zip?
I have this script to append to a zip file archive:
<SPAN class="keyword token">import</SPAN> zipfile
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">'appending to the archive'</SPAN>
zf <SPAN class="operator token">=</SPAN> zipfile<SPAN class="punctuation token">.</SPAN>ZipFile<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'W:\Data\WillCounty_AddressPoint.zip'</SPAN><SPAN class="punctuation token">,</SPAN> mode<SPAN class="operator token">=</SPAN><SPAN class="string token">'a'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
zf<SPAN class="punctuation token">.</SPAN>write<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Z:\Jared\Disclaimer - Final.txt'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">finally</SPAN><SPAN class="punctuation token">:</SPAN>
zf<SPAN class="punctuation token">.</SPAN>close<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
The problem is that I included the whole file path on line 6, so the whole folder (Jared) was appended to the zip and not just the (.txt) file.
If I exclude the path and type only the file name it can't be found?

Is there a way to just append the (.txt) file to the zip file?