I've got a folder called: 'files' which contains lots of jpg photographs. I've also got a file called 'temp.kml'. I want to create a KMZ file (basically a zip file) which contains the temp.kml file AND the files directory which has the photographs sitting inside it.
Here is my code:
zfName = 'simonsZip.kmz'
foo = zipfile.ZipFile(zfName, 'w')
foo.write("temp.kml")
foo.close()
os.remove("temp.kml")
This creates the kmz file and puts the temp.kml inside. But I also want to put the folder called 'files' in as well. How do I do this?
I read here on StackOverflow that some people have used shutil to make zip files. Can anyone offer a solution?