Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- HOST = "localhost"
- PORT = 9999
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.connect((HOST, PORT))
- sock.send("Hello World")
- data = sock.recv(1024)
- sock.close()
- print ("Received", repr(data))
- ---------
- ERROR
- --------
- Traceback (most recent call last):
- File "C:\Users\ninja\Desktop\client.py", line 8, in <module>
- sock.send("Hello World")
- TypeError: 'str' does not support the buffer interface
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement