[python-win32] Getting Network Information/Statistics

Paul Koning pkoning at equallogic.com
Thu Jan 24 20:28:33 CET 2008


>>>>> "Alexander" == Alexander Belyaev <belyaev at smartdesktop.com> writes:

 Alexander> I am new to python and so far could not figure out what
 Alexander> 'tp' means in the following?

 >>    tp,val = win32pdh.GetFormattedCounterValue( hc, win32pdh.PDH_FMT_LONG )
 >>    print hex(tp),val

I don't know that specific function, but the Python syntax:

   x, y = thing

indicates that "thing" is a tuple (of two elements in this case) and
the elements of that tuple are assigned to x and y.

In the example you mentioned, the function returns a two-tuple, and
those two parts are assigned to tp and val respectively.

You might want to find and read a good Python tutorial (or textbook)
if this material is new to you.

      paul



More information about the python-win32 mailing list