[python-win32] Re: wmi + pythonservice : multithreading issues
-> pdh returns an error
Cedric Delfosse
cedric.delfosse at linbox.com
Tue Aug 17 11:14:29 CEST 2004
Le mar 17/08/2004 à 11:05, Aloys Baillet a écrit :
> Hello all,
>
> With some more searches, I discovered the win32pdhutil package, and I
> tried the sample example given in the win32pdhutil.py file:
> <code>
> import win32pdhutil
> print win32pdhutil.GetPerformanceAttributes("Memory", "Available Bytes")
> </code>
>
I think you need to do it like that
<code>
import win32pdhutil
memory = win32pdhutil.find_pdh_counter_localized_name("Memory")
avail = win32pdhutil.find_pdh_counter_localized_name("Available Bytes")
print win32pdhutil.GetPerformanceAttributes(memory, avail)
</code>
because of l10n.
Regards,
--
Cédric Delfosse Linbox / Free&ALter Soft
152, rue de Grigy - Technopole Metz 57070 Metz - FRANCE
tél: +33 (0)3 87 50 87 90 http://linbox.com
More information about the Python-win32
mailing list