I am a java programmerr but sometimes program in python.I must say python is very easy to do stuff that requires very verbose coding in java. To create a zip file in python all you need to do is :
import zipfile
restoreZip = zipfile.ZipFile("test.zip", "w")
restoreZip.write(physicalPathOfFile, logicalPathOfFileInZip)
restoreZip.close()
Now python doesnt compress by default so you need to add compression mode while opening zip file
restoreZip = zipfile.ZipFile("test.zip", "w", zipfile.ZIP_DEFLATED)
solved the issue
import zipfile
restoreZip = zipfile.ZipFile("test.zip", "w")
restoreZip.write(physicalPathOfFile, logicalPathOfFileInZip)
restoreZip.close()
Now python doesnt compress by default so you need to add compression mode while opening zip file
restoreZip = zipfile.ZipFile("test.zip", "w", zipfile.ZIP_DEFLATED)
solved the issue
thanks for the info. (u were quoted in StackOverFlow)
ReplyDeleteA google wanderer
awesome code...
Delete