def _get_local_ip():
 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 s.connect(('google.com', 80))
 ip = s.getsockname()[0]
 s.close()
 return ip

def _get_local_ip ( ) : s = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) s . connect ( ( 'google.com' , 80 ) ) ip = s . getsockname ( ) [ 0 ] s . close ( ) return ip
a hack way to find the local ip without using any python libraries .