shutil和zipfile压缩模块

 1 import shutil
 2 import zipfile
 3 
 4 #shutil.make_archive('电影/港台/周星驰','zip','m')
 5 '''
 6 z1 = zipfile.ZipFile('c.zip','w')
 7 z1.write('b.txt')
 8 z1.write('e.txt')
 9 z1.close
10 '''
11 #解压缩
12 z2 = zipfile.ZipFile('c.zip','r')
13 z2.extractall('1')
14 z2.close()