@staticmethod
def read_from_meminfo():
    'Read information from /proc/meminfo.'
    meminfo = {}
    with open('/proc/meminfo') as fd:
        for line in fd.readlines():
            if line:
                fields = line.split()
                if ((len(fields) >= 2) and fields[1].isdigit()):
                    meminfo[fields[0].rstrip(':')] = int(fields[1])
    return meminfo
Read information from /proc/meminfo.
@staticmethod
def read_from_meminfo():
    
    meminfo = {}
    with open('/proc/meminfo') as fd:
        for line in fd.readlines():
            if line:
                fields = line.split()
                if ((len(fields) >= 2) and fields[1].isdigit()):
                    meminfo[fields[0].rstrip(':')] = int(fields[1])
    return meminfo