def read_from_vmstat(key):
 vmstat = open('/proc/vmstat')
 vmstat_info = vmstat.read()
 vmstat.close()
 return int(re.findall(('%s\\s+(\\d+)' % key), vmstat_info)[0])

def read_from_vmstat ( key ) : vmstat = open ( '/proc/vmstat' ) vmstat_info = vmstat . read ( ) vmstat . close ( ) return int ( re . findall ( ( '%s\\s+(\\d+)' % key ) , vmstat_info ) [ 0 ] )
get specific item value from vmstat .