Q: Network access & Python

Martin von Loewis loewis at informatik.hu-berlin.de
Wed Jan 12 15:28:09 EST 2000


Christian Schaller <Christian.Schaller at mchp.siemens.de> writes:

>   Does anyone know if there's a module in Python for getting network
> stats?  I want to write a tool for displaying all used ports and
> services running on them and also if there's a connection on a port,
> from where (ip:port) it originates, but found no function/module
> containing functions for listing/analyzing ports.

How to obtain such information highly depends on the operating system
you are using; I don't know any module covering this for a variety of
operating systems.

For example, if you are using Linux, you can easily obtain this
information from the /proc filesystem; reading /proc/net/tcp will give
you all open sockets.

Regards,
Martin



More information about the Python-list mailing list