python解压缩ZIP格式文件

import zipfile
import os
z = zipfile.ZipFile('C:/bin.zip', 'r')
for f in z.namelist():
    if z.read(f)=="":
        if not os.path.isdir("C:/test/"+f):
            os.mkdir("C:/test/"+f)
    else:
        ff = open("C:/test/"+f,'wb')
        ff.write(z.read(f))
        ff.close()
z.close()
    

你可能感兴趣的:(c,python,import)