I am trying to write a socket program using Python. In my client side I have this section:
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName, serverPort))
linesInBytes = clientSocket.recv(1024)
print(linesInBytes)
AND in my Server side I have:
connectionSocket, addr = serverSocket.accept()
#Set secret word
word = 'Arkansas'
linesForString = ''
#Prints out number of letters
for x in word:
linesForString += '_ '
linesInBytes = linesForString.encode('utf-8')
connectionSocket.send(linesInBytes)
And for some reason when it prints out on the client side, it prints out:
b'_ _ _ _ _ _ _ _ '
And there is no where in the code where I print out a b. Where is this b coming from?? Thank you!