[python-win32] WMI processor class is very slow?

2010-03-04 Thread Alex Hall
Hi all, I wrote a couple hours ago asking why wmi information about my processor (core and overall load) is very slow, delaying up to ten or fifteen seconds when disk and ram information is immediate. Here is the link to the zipped project file. I do not have svn or anything fancy like that. Note t

Re: [python-win32] wmi: processor class seems slow

2010-03-04 Thread Alex Hall
I do specify the field(s) I want, but this has not significant affect on processor-related information access times. I will upload a zip file of the entire thing, including dependencies, to my site soon and will email the list with the above question (for reference) and a link to the zip file. Than

Re: [python-win32] wmi: processor class seems slow

2010-03-04 Thread Tim Golden
On 04/03/2010 18:42, Alex Hall wrote: Hi all, I have a script that gets the load of a given core, or the average of all cores, along with other information, like free ram and hard disk space. The script runs fine, but when I give it processor-related commands it is sometimes rather fast and somet

[python-win32] wmi: processor class seems slow

2010-03-04 Thread Alex Hall
Hi all, I have a script that gets the load of a given core, or the average of all cores, along with other information, like free ram and hard disk space. The script runs fine, but when I give it processor-related commands it is sometimes rather fast and sometimes quite slow. Delays range from one t

Re: [python-win32] WMI script that shows general info about a computer (SOLVED)

2010-03-04 Thread python
Hi Tim, > Well I'm always glad to hear a positive comment on the > source code, but there *is* some documentation: > > http://timgolden.me.uk/python/wmi/index.html > http://timgolden.me.uk/python/wmi/tutorial.html > http://timgolden.me.uk/python/wmi/cookbook.html I read and enjoyed all your docum

Re: [python-win32] How to enumerate a WMI object to discover its properties?

2010-03-04 Thread python
Hi Tim, Thanks to your help, here's what I'm using to record interesting information about our workstation inventory. It works great! c = wmi.WMI().Win32_ComputerSystem computer = c()[0] for propertyName in sorted( list( c.properties ) ): print '%s = %s' % ( propertyName, getattr( compute

Re: [python-win32] MIDL & MakePy

2010-03-04 Thread Tim Roberts
Dave Cross wrote: > > Can anyone explain how MakePy interprets COM IDL? Well, remember that MakePy does not interpret IDL. MakePy reads the TLB, which is the compiled version of the IDL. By the time MakePy sees it, it's already been through one level of interpretation. > If I define: > HRESUL

[python-win32] MIDL & MakePy

2010-03-04 Thread Dave Cross
Hi all, Can anyone explain how MakePy interprets COM IDL? If I define: HRESULT Test([out] byte* outp); Makepy generates: """method Test""" return self._ApplyTypes_(3, 1, (24, 0), ((16401, 2),), u'Test', None,outp) and I can interpret (16401,2) as VT_UI1, BYREF and OUT. If, however, I defin

Re: [python-win32] How to enumerate a WMI object to discover its properties?

2010-03-04 Thread Tim Golden
On 04/03/2010 06:38, pyt...@bdurham.com wrote: Is there a way to enumerate a WMI object's properties to discover what they are vs. having to explictly reference properties by name? Assuming I understand the question, a quickie shortcut is just to "print" the object: import wmi c = wmi.WMI ()

Re: [python-win32] WMI script that shows general info about a computer (SOLVED)

2010-03-04 Thread Tim Golden
On 04/03/2010 06:30, pyt...@bdurham.com wrote: OP here. When in doubt, read the (very well commented) wmi.py source code :) computerSystem = wmi.WMI().Win32_ComputerSystem()[0] Well I'm always glad to hear a positive comment on the source code, but there *is* some documentation: http://timgol