importos,pyzipper,py7zr
公式报表文件
defx(: )一次解压、提取、删除
foriinos.listdir(Path ) :
if'.zip'ini:
route=OS.path.join(path,I ) ) ) ) ) ) )。
withpyzipper.AESzipfile(route,' r ' ) asf:
f .提取全部(path ) )。
OS.remove(route ) )。
elif'.rar'ini:
OS.chdir(Path ) )。
route=OS.path.join(path,I ) ) ) ) ) ) )。
rar=rarfile.rarfile(I ) )
rar.extractall(path ) )。
是OS.remove(I )
elif'.7z'ini:
OS.chdir(Path ) )。
是OS.remove(I )
x () )。
defunpack(:#循环解冻
while1:
x () )。
zips=[]
forjinos.listdir(Path ) :
IFJ.endswith () (.zip ),).rar ) ) :
ZIPS.append(j ) )。
ifnotzips:
布莱克
unpack () ) )