📜  循环遍历文件夹以提取 zip winrar python 代码示例

📅  最后修改于: 2022-03-11 14:45:52.671000             🧑  作者: Mango

代码示例2
for root, dirs, files in os.walk(path):
    if not any(f.endswith(".mkv") for f in files):
        for file in files:
            pth = join(root, file)
            if file.endswith("zip"):
                print("Unzipping ",file, "...")
                check_call(["unzip" , pth, "-d", root])
            elif file.endswith((".rar",".r00")):
                check_call(["unrar","e", pth,  root])