text: import socket
  
  def get_ip():
      s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      ip = 'localhost'
      try:
          s.connect(('10.255.255.255', 1))
          ip = s.getsockname()[0]
      except:
          ip = '127.0.0.1'
      return ip