我想解压缩不同路径中不同目录中的文件.代码如下,错误是无效的数据流.请帮帮我.非常感谢.
import sys
import os
import bz2
from bz2 import decompress
path = "Dir"
for(dirpath,dirnames,files)in os.walk(path):
for file in files:
filepath = os.path.join(dirpath,filename)
newfile = bz2.decompress(file)
newfilepath = os.path.join(dirpath,newfile)
Run Code Online (Sandbox Code Playgroud)