DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Python (http://www.daniweb.com/forums/forum114.html)
-   -   Accessing system resources (http://www.daniweb.com/forums/thread201750.html)

asim.mittal Jul 5th, 2009 6:05 am
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

xav.vijay Jul 7th, 2009 2:00 am
Re: Accessing system resources
 
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

Quote:

acpi -V
Hope this helps...


All times are GMT -4. The time now is 3:20 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC