(nic_name)
return(host)
translates the name of a network card into a valid host name
translates the name of a network card into a valid host name
translates the name of a network card into a valid host name
def nic_name_to_host(nic_name):
	""" translates the name of a network card into a valid host name"""
	from netifaces import ifaddresses, AF_INET
	host = ifaddresses(nic_name).setdefault(AF_INET, [{'addr': 'No IP addr'}] )[0]['addr']
	return(host)
def nic_name_to_host ( nic_name ) : from netifaces import ifaddresses , AF_INET host = ifaddresses ( nic_name ) . setdefault ( AF_INET , [ { 'addr' : 'No IP addr' } ] ) [ 0 ] [ 'addr' ] return ( host )