[python-win32] WMI troubles!

Alex Hall mehgcap at gmail.com
Fri Jan 15 21:57:28 CET 2010


Subject: Re: [python-win32] WMI troubles!


> On 15/01/2010 19:38, Alex Hall wrote:
>> I do not want a single script because, eventually, the plan is to have a
>> keystroke for core 1, a keystroke for core 2, a keystroke for percent of
>> ram used, a keystroke for hard disk space, and so on. While I could
>> write each function in its own script and put a hotkey on each one, it
>> seems easier and faster to just make one script and run it once,
>> avoiding the delay I always get when this script runs for the first time
>> from happening each time I press a hotkey.
>
> I've got slightly lost in this thread (not helped, I'm
> afraid Alex, by your habit of top-posting ;) ) but in
> an effort to be helpful, can I suggest the following.
> Instead of fiddling with pyHooks which are -- as Tim R
> points out -- somewhat dark and messy, consider adapting
> the following example instead:
>
> http://timgolden.me.uk/python/win32_how_do_i/catch_system_wide_hotkeys.html
>
> This uses a straightforward Windows message loop to
> provide to sort of global hotkeys I think you're after.
> You might, for example, change the handle_win_f3
> function to start a wmi instance (or use an existing
> one) and then produce the output you were after.

Thanks!! I "top post" since, when you use a screen reader, it is far easier 
to read a response straight away than it is to wade through a bunch of text 
you have already read, complete with many repetitions of "greater than". I 
will try to make in-line comments.
Anyway, I have copied the example you provided and am about to go modify it. 
If it works, it should help a lot! I just hope it will clear up the wmi 
errors I keep getting... Thanks for the link!
>
> TJG
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32 



More information about the python-win32 mailing list