zip 解压脚本

zip 解压脚本

gpk-unzip.py

 

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# unzip-gbk.py

import os
import sys
import zipfile

print "Processing File " + sys.argv[1]

file=zipfile.ZipFile(sys.argv[1],"r");
for name in file.namelist():
    utf8name=name.decode('gbk')
    print "Extracting " + utf8name
    pathname = os.path.dirname(utf8name)
    if not os.path.exists(pathname) and pathname!= "":
        os.makedirs(pathname)
    data = file.read(name)
    if not os.path.exists(utf8name):
        fo = open(utf8name, "w")
        fo.write(data)
        fo.close
file.close()

 

转载于:https://www.cnblogs.com/sxwen/p/8245309.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用.bat脚本进行7zip解压可以通过以下步骤实现: 1. 确保电脑已经安装了7zip程序。 2. 创建一个新的文本文件,将以下代码粘贴到文本文件中并保存为.bat文件。 ``` @echo off set "zip_path=path/to/7zip" [1] set "file_path=path/to/your/file.zip" [2] "%zip_path%\7z.exe" x "%file_path%" -o"path/to/output/folder" [3] ``` 在上述代码中,需要根据实际情况修改以下内容: - 将"path/to/7zip"替换为7zip程序的安装路径。 - 将"path/to/your/file.zip"替换为要解压文件的路径和文件名。 - 将"path/to/output/folder"替换为解压文件的输出目录。 3. 双击运行该.bat文件,7zip将自动解压指定的文件到指定的输出目录中。 请注意,在运行.bat脚本之前,请确保已经正确配置了7zip程序的安装路径和要解压文件路径。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [bat脚本运行.sql文件.zip](https://download.csdn.net/download/Real666/12254949)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [快速解压和压缩rar文件【bat脚本】](https://download.csdn.net/download/qq_44274344/86246534)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [.bat脚本基本命令语法](https://blog.csdn.net/Soliloquy_XD/article/details/96752940)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值