directory.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:myterminal 作者: graktung 项目源码 文件源码
def zipGetComSize(content):
    content = content.split()
    if len(content) > 1:
        try:
            zipFile = zipfile.ZipFile(content[1])
            infoOfFile = zipFile.getinfo(content[0])
            zipFile.close()
            return [str(infoOfFile.compress_size) + ' KB']
        except FileNotFoundError:
            return ['1f401268File %r Not Found' %(content[1])]
        except zipfile.BadZipFile:
            return ['1f401268File %r is not a zip file' %(content[1])]
        except KeyError:
            return ['1f401268There no item named %r in the archive' %(content[0])]
        except:
            return ['Something went wrong when trying to handel file %r' %(content[1])]
    else:
        return ['zip getfilesize item file_zip']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号