def get_interface_addresses():
addresses = []<EOL>ifaces = netifaces.interfaces()<EOL>for iface in ifaces:<EOL><INDENT>addrs = netifaces.ifaddresses(iface)<EOL>families = addrs.keys()<EOL>if netifaces.AF_INET in families:<EOL><INDENT>families.remove(netifaces.AF_INET)<EOL>families.append(netifaces.AF_INET)<EOL><DEDENT>for family in families:<EOL><INDENT>for addr in addrs[family]:<EOL><INDENT>address = {<EOL>'<STR_LIT:name>': iface,<EOL>'<STR_LIT>': family,<EOL>'<STR_LIT>': addr['<STR_LIT>'],<EOL>}<EOL>addresses.append(address)<EOL><DEDENT><DEDENT><DEDENT>return addresses<EOL>
Get addresses of available network interfaces.
See netifaces on pypi for details.

Returns a list of dicts