how to get the hostname of a machine code example Example: get hostname socket.gethostbyname(socket.gethostname())