I just wrote the code with Python 3.6.1, I am just a beginner in python. while compiling having below error, can anyone help me in this
TypeError: a bytes-like object is required, not 'str' The code I wrote: import socket mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect(('data.pr4e.org', 80)) mysock.send('GET http://data.pr4e.org/intro-short.txt HTTP/1.0\n\n') while True: data =x.recv(512) if ( len(data) < 1 ) : break print (data) mysock.close() -- https://mail.python.org/mailman/listinfo/python-list