def thishost():
 global _thishost
 if (_thishost is None):
  try:
   _thishost = socket.gethostbyname(socket.gethostname())
  except socket.gaierror:
   _thishost = socket.gethostbyname('localhost')
 return _thishost

def thishost ( ) : global _thishost if ( _thishost is None ) : try : _thishost = socket . gethostbyname ( socket . gethostname ( ) ) except socket . gaierror : _thishost = socket . gethostbyname ( 'localhost' ) return _thishost
return the ip address of the current host .