code: def get_self_ip():
          '''
          Find out localhost outside IP.
  
          :return:
          '''
          sck = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
          try:
              sck.connect(('1.255.255.255', 1))  # Does not needs to be reachable
              ip_addr = sck.getsockname()[0]
          except Exception:
              ip_addr = socket.gethostbyname(socket.gethostname())
          finally:
              sck.close()
          return ip_addf get_self_ip():
          '''
          Find out localhost outside IP.
  
          :return:
          '''
          sck = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
          try:
              sck.connect(('1.255.255.255', 1))  # Does not needs to be reachable
              ip_addr = sck.getsockname()[0]
          except Exception:
              ip_addr = socket.gethostbyname(socket.gethostname())
          finally:
              sck.close()
          return ip_addr
docs: Find out localhost outside IP.
  
          :return: