getting local area connection information through python in windows

sturlamolden sturla at molden.no
Sat May 22 04:12:56 EDT 2010


On 22 Mai, 09:38, moijes12 <moije... at gmail.com> wrote:

> I need to get the details of Local Area connection information(network
> interface) like packets sent,packets recieved,duration etc. I have to
> do this in Windows using python.


>>> import subprocess as sp

>>> p = sp.Popen("netstat -s", shell=False, bufsize=4096,
              stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)

>>> print ''.join(p.stdout.readlines())

>>> p.terminate()

There are other switches for the netstat command as well.




More information about the Python-list mailing list