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