diff --git a/bindings/python/examples/free.py b/bindings/python/examples/free.py new file mode 100644 index 00000000..c57fca88 --- /dev/null +++ b/bindings/python/examples/free.py @@ -0,0 +1,21 @@ +import os, sigar; + +sg = sigar.open() +mem = sg.mem() +swap = sg.swap() +sg.close() + +print "\tTotal\tUsed\tFree" + +print "Mem:\t",\ + (mem.total() / 1024), \ + (mem.used() / 1024), \ + (mem.free() / 1024) + +print "Swap:\t", \ + (swap.total() / 1024), \ + (swap.used() / 1024), \ + (swap.free() / 1024) + +print "RAM:\t", mem.ram(), "MB" +