On Wed, 13 Jul 2005 11:09:57 +0300, Edvard Majakari <[EMAIL PROTECTED]> wrote: > > Suppose one wants to fetch the following data from given network interface, > say, eth0: > >>>> Ethinf('eth0').addr() > '192.168.1.42/24' ... >>>> Ethstat('eth0').rx_bytes() > 14325235341223 ... > One could implement modules by installing eg. ethtool and reading speed/duplex > information by parsing ethtool output, but it is ugly way to do it, prone to > errors, requires launching a process as well as installation of ethtool.
On the other hand, I have a hunch that the interface that ethtool uses is unstable, changes between major kernel versions, varies with the kind of hardware you have, etc. If that is the case, you might want to keep parsing ethtool's output. Letting /them/ worry about tracking kernel changes would actually be the most stable solution. The ethtool authors are kernel developers, and probably know all that stuff. Or convince the ethtool authors to release future ethtool versions as a Python module with an optional command-line interface ;-) /Jorgen -- // Jorgen Grahn <jgrahn@ Ph'nglui mglw'nafh Cthulhu \X/ algonet.se> R'lyeh wgah'nagl fhtagn! -- http://mail.python.org/mailman/listinfo/python-list