Skip to content

Instantly share code, notes, and snippets.

@litefeel
Created June 14, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save litefeel/cdbbd43dc0024cd34175 to your computer and use it in GitHub Desktop.
Save litefeel/cdbbd43dc0024cd34175 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# coding=utf-8
import os, os.path
import gzip, zipfile
print zipfile.is_zipfile("test.zip")
f = zipfile.ZipFile("test.zip")
for info in f.infolist():
print info.filename
# f = gzip.open("xxx.zip", "wb")
# f.close()
# myf = zipfile.ZipFile("xxx.zip", "w")
# print "----------------------"
# myf.write("xxxx")
# myf.write("xxxx/abc.txt")
# # f = zipfile.ZipFile("xxx.zip")
# for info in myf.infolist():
# print info.filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment