from socket import *    #import networking tools
m = input("Send a string: ")    #prompt for a string
serverPort = 8000   #server port
serverName = "116.255.5.177"    #server ip
clientSocket = socket(AF_INET,SOCK_STREAM)  #setup an ipv4 (AF_INET) socket that can access networks through TCP (SOCK_STREAM)
clientSocket.connect((serverName, serverPort))  #Handshake with the server
clientSocket.send(m.encode())   #Send the variable `m` in raw bits 
r = clientSocket.recv(1024) #Store the server's 1024 bits as a variable called `r`
print(r.decode())   #Decode `r` from raw bits and print it
clientSocket.close()    #say goodbye to the kind server

