1、vi uzip(文件名)
2、复制以下Python程序

 1 #!/usr/bin/env python
 2 # -*- coding: utf-8 -*-
 3 # uzip.py
 4  
 5 import os
 6 import sys
 7 import zipfile
 8  
 9 print "Processing File " + sys.argv[1]
10  
11 file=zipfile.ZipFile(sys.argv[1],"r");
12 for name in file.namelist():
13     utf8name=name.decode('gbk')
14     print "Extracting " + utf8name
15     pathname = os.path.dirname(utf8name)
16     if not os.path.exists(pathname) and pathname!= "":
17         os.makedirs(pathname)
18     data = file.read(name)
19     if not os.path.exists(utf8name):
20         fo = open(utf8name, "w")
21         fo.write(data)
22         fo.close
23 file.close()

3、chmod +x uzip
4、./uzip xxxx.zip

亲测有效,:)

相关文章:

  • 2022-02-12
  • 2021-12-10
  • 2021-11-16
  • 2021-07-24
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2021-11-14
  • 2021-04-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
相关资源
相似解决方案