views:

219

answers:

3

I'd like to write some quick Python code to assess the CPU, memory, disk, and networking usage of my Windows XP system.

Are there existing Python libraries that would allow me to access that information? Or, are there DLL's that I can call from Python? (If so, a code sample would be appreciated)

+4  A: 

I think WMI is the resource to use. Especially, look at the Win32_PerfFormattedData* classes in the MSDN.

A quick search turned this up (among others):

http://timgolden.me.uk/python/wmi.html

Tomalak
A: 

See also the Microsoft Script Repository which has a number of examples of using python and win32com.

John Fouhy
A: 

The MS Scriptomatic tool can generate WMI scripts in Python as well as VBScript, JScript and Perl.

Patrick Cuff