code: def get_interface_addresses():
      
  
      addresses = []
      ifaces = netifaces.interfaces()
      for iface in ifaces:
          addrs = netifaces.ifaddresses(iface)
          families = addrs.keys()
  
          # put IPv4 to the end so it lists as the main iface address
          if netifaces.AF_INET in families:
              families.remove(netifaces.AF_INET)
              families.append(netifaces.AF_INET)
  
          for family in families:
              for addr in addrs[family]:
                  address = {
                      'name': iface,
                      'family': family,
                      'ip': addr['addr'],
                  }
                  addresses.append(address)
  
      return addresses
docs: Get addresses of available network interfaces.
      See netifaces on pypi for details.
  
      Returns a list of dicts