Open chadbrubaker opened 9 years ago
Python netifaces package can be made used to find the IP address of the all the interfaces.
from netifaces import interfaces, ifaddresses, AF_INET for ifaceName in interfaces(): addresses = [i['addr'] for i in ifaddresses(ifaceName).setdefault(AF_INET, [{'addr':'No IP addr'}] )] print '%s: %s' % (ifaceName, ', '.join(addresses))
Can I work on this?
As seen in #17 ifconfig output is platform dependent and we should find a more platform independent way to find all the ip addresses bound to interfaces.