python socket programming get protocol code example Example: socket hostname socket.gethostbyname(socket.gethostname())