I'm trying to compress a file and a folder that has multiple files inside it into a single .zip file using Python. The script is as follows:
from zipfile import ZipFile,ZIP_DEFLATED
def zipar(lista):
with ZipFile('teste.zip','w',ZIP_DEFLATED) as z:
for i in lista:
z.write(i)
zipar(['registro.py','Tudo'])
When you run the script, it compacts "registry.py" and the "All" folder, but the files that are inside the original "All" folder are not packed together, ie the folder is compressed empty. How do I fix this?