954,164 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Accessing system resources

Hey

I use both windows vista and Ubuntu (mostly) for developing small py scripts. I wanted to know if there were any libraries or modules available to get information about system resources like :
- Source of power (ac or battery)
- how much battery time is left
- Is there any network activity
- how much CPU / Memory is being used

Basically all the things that Task Manager(windows) or System Monitor(linux) would do for you. I wanna do this using a PY script. (or if there is a way to do it at the linux shell)

Any info would be greatly appreciated.

Thanks,
Asim

asim.mittal
Newbie Poster
2 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

For windows look for WMI scripting queries that would fetch you the required info. You can use the same in the python. The Microsoft site has plenty of details on that.

For Ubuntu, you will have to look for the file which stores that info. It could be in /proc.

A google search for "Ubuntu + battery" gave me something called

acpi -V

Hope this helps...

xav.vijay
Junior Poster in Training
55 posts since Aug 2005
Reputation Points: 10
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You