I receive data from a socket in Python 3 with
data = ""
data = s.recv(1024)
When I want to
print (type(data)), it tells me:
How can I convert
data back to a string so it only shows
print(data)? I tried a lot with
.encode, but it does not seem to work in Python 3.
You can just do
str(data, 'utf-8') to convert bytes to string.