#!/usr/bin/python

# tz_cpu.py
#       --copyright--                   Copyright 2012 (C) Tranzoa, Co. All rights reserved.    Warranty: You're free and on your own here. This code is not necessarily up-to-date or of public quality.
#       --url--                         http://www.tranzoa.net/tzpython/
#       --email--                       pycode is the name to send to. tranzoa.com is the place to send to.
#       --bodstamps--
#       September 4, 2012       bar
#       September 18, 2012      bar     cmd line pid, optional
#       --eodstamps--
##      \file
#       \namespace              tzpython.tz_cpu
#
#
#       CPU information.
#
#


#
#
#       Test code
#
#
if  __name__ == '__main__' :
    import  sys

    pid = 2218
    if  len(sys.argv) > 1 :
        pid = int(sys.argv[1])

    #
    #       note: os.system('free')     can be used
    #       note: os.system('vmstat')   can be used
    #
    #           buffers and cached are, apparently, instantly available to be used
    #
    mi  = open('/proc/meminfo', "r").read()
    print mi

    pi  = open('/proc/%u/status' % pid, "r").read()
    print pi

#
#
# eof
