我想解压缩位于不同路径的不同目录中的文件。并且代码如下,并且错误是无效的数据流。请帮帮我。太感谢了。
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)
相关分类