python script to get windows host name code example Example: get hostname socket socket.gethostbyname(socket.gethostname())