标签:file dir mkdir ret unzip exists for rac 文件
@staticmethod
def unzip_file(failed_file):
zip_file = zipfile.ZipFile(failed_file)
print(zip_file)
if os.path.isdir(failed_file[0:-20]):
pass
else:
os.mkdir(failed_file[0:-20])
for names in zip_file.namelist(): # 解压
zip_file.extract(names, failed_file[0:-20])
zip_file.close()
if os.path.exists(failed_file): # 删除zip文件
os.remove(failed_file)
# print(failed_file[0:-20], ‘解压成功‘)
return failed_file[0:-20]
标签:file dir mkdir ret unzip exists for rac 文件
原文地址:https://www.cnblogs.com/tester-yu/p/14858517.html