python equivalent of hostname code example Example: get hostname socket socket.gethostbyname(socket.gethostname())