def get_loadavg():
 if (platform.system() == 'Linux'):
  return open('/proc/loadavg').read().split()[:3]
 else:
  command = 'uptime'
  process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
  stdout = process.communicate()[0].strip()
  output = re.split('[\\s,]+', stdout)
  return output[(-3):]

def get_loadavg ( ) : if ( platform . system ( ) == 'Linux' ) : return open ( '/proc/loadavg' ) . read ( ) . split ( ) [ : 3 ] else : command = 'uptime' process = subprocess . Popen ( command , stdout = subprocess . PIPE , shell = True ) stdout = process . communicate ( ) [ 0 ] . strip ( ) output = re . split ( '[\\s,]+' , stdout ) return output [ ( - 3 ) : ]
get the load average for a unix-like system .