Turn up to your favourite python shell and write these following lines to create a ZIP File:
>>> import zipfile
>>> zipArchive = zipfile.ZipFile('NewZipFile.zip','w')
>>> zipArchive.write('c:\\test1.c')
>>> zipArchive.write('c:\\test.asm')
>>> zipArchive.write('c:\\cb.bmp')
>>> zipArchive.close()
Now write this to get the current working directory:
>>> os.getcwd()
Go to that directory and you will find you zip file in it.
Creating a zip file in python
Posted by Najam at 2:07 AM 0 comments
Subscribe to:
Comments (Atom)