I want to write a program in python to capture memory and cpu readings of a process which is running on linux server and save the readings in a tabular format to any .doc or .csv file. Got to know that 'top' command would give the cpu and memory readings which a process occupies/utilises on the linux server. As I am quite new to Python, I am not sure what functions can be used to achieve this requirement.
Is this very simple program to do it, can someone guide/help me in it. Also,can someone share me a sample python script if any such available.