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
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment