摘要: 项目中大量用到图片加载,由于图片太大,加载速度很慢,因此需要对文件进行统一压缩 安装包 python -m pip install Pillow 导入包 from PIL import Image import os 三:获取图片文件的大小 def get_size(file): # 获取文件大小: 阅读全文
posted @ 2021-04-09 17:56 陨落&新生 阅读(5494) 评论(0) 推荐(0) 编辑
摘要: 生成uuid import shortuuid def get_unique_id(): su = shortuuid.ShortUUID(alphabet="0123456789") _id = int(su.random(length=19)) return _id 19 位的guid impo 阅读全文
posted @ 2021-04-09 17:45 陨落&新生 阅读(775) 评论(0) 推荐(0) 编辑