List of IP addresses/hostnames from local network in Python

Posted by joshhunt on Stack Overflow See other posts from Stack Overflow or by joshhunt
Published on 2008-10-16T02:32:33Z Indexed on 2010/04/23 23:43 UTC
Read the original article Hit count: 281

Filed under:
|

How can I get a list of the IP addresses or host names from a local network easily in Python?

It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow.

Edit: By local I mean all active addresses within a local network, such as 192.168.xxx.xxx.

So, if the IP address of my computer (within the local network) is 192.168.1.1, and I have three other connected computers, I would want it to return the IP addresses 192.168.1.2, 192.168.1.3, 192.168.1.4, and possibly their hostnames.

© Stack Overflow or respective owner

Related posts about python

Related posts about networking