python3把二进制图片文件包含在代码里的方法
我们可以把一些资源文件直接放在python的源代码里面,比如一些小的图标资源,这样就不需要携带这些资源文件了
""" 作者:皮蛋编程(http://www.pidancode.com) 创建日期:2022/3/16 修改日期:2022/3/16 功能描述:python3把二进制图片文件包含在代码里的方法 """ import base64 import zlib data = open('pidancode.png', 'rb').read() encode_data = base64.b64encode(zlib.compress(data)) print(encode_data)
这段代码将皮蛋编程网站的LOGO图片文件转换成base64编码的字节,输出结果如下:
b'eJx9d/c/G973f2KPoKhdK0btxF5FEVRRM0bNxKz9ErOhoqhZqkqpoC2qQo3aaoSaRToUoRq0KnaMEq3Rj/cf8P2ex+Pce+6954fzeNxzns9zMmxumbGxCLIAAAA28xswu4v9+YUaMjFcrI6zDf97oEMZmTswXUg8k0/6xZk5/IYLCgBgf/8/BY6Evfa5uLwSaeIcaR/mFxmDiPAFGPqEIX3FTO9E+MaERQShxIztNda632Zf+PH+z884whcReScsVMzhTogvAKoFUVaDKGv/o5bRAwB8TuYwQ4dY7HZp3BM3k8MRg2nV/LEyALPYqNylJOMUsQwxscy3MinGX/gMeQ2Bf/6gjC8vXOpHXTbk5TFhPoUZgjutYEPlx/kJzF6XLl8SR4xx0rm8vW6kMmYZc3beAZ9q8PSI6Vu3VIndomgndL3r8ug5wYV+73KF61L0QlqUHWRA6sCQU/+KSUwISHYeRBx+9PL/Y+qkPcN0X8rLxyRj4BjGBTENCsYCftiQTPQzvpw1lJBUb1cTefKgi1zCaTyMAdNIJ7Hy00bSJODmXcmPzzAVs3x6pJPNpEMCBvxWIrwFtaPmlZS+8AaXsHnSG+YYfInhct4kpoHWlSbhutmPaQHSCI0mzeL8JTVfL6tTMXApIHmSH6wi0sFQxJvZBsihi4RSDigpbFLAEdoRgJB6DdUhedEUJKJdfINhyJ+GzJs1NEfo1MWkwQ8P67LuS4qK1ENoeZ6/7NKwrtlQ4ZQF2mPqbU555kFa0PQbmo18UAZntt/Ix4q9Df06x9pwdxoF2sJPWKBn6O43BS/grk6bj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OuILhT+D+1aEG8HeXshYNqLAebqSnsGhJ5ra2bwEA4JDUgt3su7U3gV14UpY+2NFZAMooiiz3u/sh560NA+uyviJm0SgRJTCe8+L4NPTt+lq1zB3a3zYKXN2uoZlktQxKptNxWs99x0dejtw6GSCcQJPdmpMKDBIbpCqMZ5mRF4DgR1CfX9ITtcqmh5wLP5mvN11ZXn/Hee8fmuoMMjm3fTfB4GTphsz6UnSSwDMLz1Xx3jlIs9EjsSl/Y7klU2wKWpf5iKyvCoVXCX6VPHJAgFxWaLrysyzHOnb22+Omy9MiMj2rgoKClwTZiOwHvxcwsjH+c4r/Eh0+kLbf+dA+L2pFbIn/dGGlWpt2dsIkxjCUkQ1uXl0HPNCAFNw9MYE3O7biNMzDXN/dqqdgEc3yUdsdaKVF8SRMxEaXf+ncRyP/9tsxl/Zz1ZIPBwjeRKneu4B/CD1223MjttNaxlJOpEfihNXEmaY9oC36KrDniABjc1OD/XWftZea7kO2r7Znj+zFerSpQK9hu5/52Xwd9iUzzh1/797P9ExnbpijnuzfPwzxOIT2dDvku+S25w+y3uviPm6jn1pXnXqZwym9Seabimz6Oln9an+7FC6vLHi3P4Q+JiedS464Px2iTP2KSDb9qTSAXQEKYA3sBVdsIPS1/AlYK9zeTet7+YgvzXPcVZzmK10/dep80u5VoMx0E3WxnzGeiXkxj6wiM+XTPAPqfbXYnKXd7uqged3i+GUq36jfPgkLHR+wsdLo89gYVNmsV49SvfM5Yd0Pn/Z0SgvcMoxMV2rpFQRO1DnJp/p895ArqByuR2tfI21YBMcsiENzGRQDIt/Hun3Po25UrA9J+zPPbtQg0PhQ3KQF++3+ZpwZl+DysIzvXe8CFmJvcgtUbed3/Px5C0XE='
# 把上面代码输出的结果存储在变量里面: import base64 import zlib logo_file = zlib.decompress(base64.b64decode(b'eJx9d/c/G973f2KPoKhdK0btxF5FEVRRM0bNxKz9ErOhoqhZqkqpoC2qQo3aaoSaRToUoRq0KnaMEq3Rj/cf8P2ex+Pce+6954fzeNxzns9zMmx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Q1uXl0HPNCAFNw9MYE3O7biNMzDXN/dqqdgEc3yUdsdaKVF8SRMxEaXf+ncRyP/9tsxl/Zz1ZIPBwjeRKneu4B/CD1223MjttNaxlJOpEfihNXEmaY9oC36KrDniABjc1OD/XWftZea7kO2r7Znj+zFerSpQK9hu5/52Xwd9iUzzh1/797P9ExnbpijnuzfPwzxOIT2dDvku+S25w+y3uviPm6jn1pXnXqZwym9Seabimz6Oln9an+7FC6vLHi3P4Q+JiedS464Px2iTP2KSDb9qTSAXQEKYA3sBVdsIPS1/AlYK9zeTet7+YgvzXPcVZzmK10/dep80u5VoMx0E3WxnzGeiXkxj6wiM+XTPAPqfbXYnKXd7uqged3i+GUq36jfPgkLHR+wsdLo89gYVNmsV49SvfM5Yd0Pn/Z0SgvcMoxMV2rpFQRO1DnJp/p895ArqByuR2tfI21YBMcsiENzGRQDIt/Hun3Po25UrA9J+zPPbtQg0PhQ3KQF++3+ZpwZl+DysIzvXe8CFmJvcgtUbed3/Px5C0XE=')) print("文件大小:{}".format(len(logo_file)))
显示图片:
from PIL import Image import io img = Image.open(io.BytesIO(logo_file)) img.show()
以上代码在Python3.9环境下测试通过。
相关文章