I want to get bytes sent and received in total and by each application if possible. I tried winpdh and winpdhutil but it reports the wrong number for Received in XP and doesn't seem to work for network stats in Vista:
[code] >>> import win32pdh >>> intf = 'Intel[R] PRO_100 Network Connection' >>> hq = win32pdh.OpenQuery() >>> cp = win32pdh.MakeCounterPath( (None, 'Network Interface', intf, None, -1, 'Bytes Received/sec') ) >>> hc = win32pdh.AddCounter( hq, cp ) >>> type,val = win32pdh.GetFormattedCounterValue( hc, win32pdh.PDH_FMT_LONG) Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> type,val = win32pdh.GetFormattedCounterValue( hc, win32pdh.PDH_FMT_LONG) error: (-2147481645, 'GetFormattedCounterValue', 'No error message is available' [/code]
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32