[Tutor] Finding all IP addresses associated with a host
scott.newton at gmail.com
Thu Apr 9 23:52:17 CEST 2009
I'm very new to python, and my google-fu has failed to locate an answer to
How can I find all of the (ipv4) addresses that are currently up on a host?
I realize I can call ifconfig and then munge the output with awk, but that
seems messy, and before I tried that I though I would ask around.
To give a bit more information, I'm writing a script that will use the ip
address assigned to the wifi interface to determine location (this is on a
Mac) and then mount network drives appropriate to the location. If anyone
has a better idea how to do this, I'd be happy to hear them.
Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor