我就废话不多说了,直接上代码! from enum import Enum class Values(): values={'B':1} @staticmethod def getValues(): if len(Values.values)<=1: kbunits=['KB','MB','GB','TB','PB','EB','ZB','YB','BB','NB','DB'] kibunits=['KiBi','MiB','GiB','TiB','PiB','EiB','ZiB','YiB','BiB','NiB','DiB']