SHARE
TWEET

Untitled

a guest Sep 13th, 2017 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import socket
  2.  
  3. HOST = "localhost"
  4. PORT = 9999
  5.  
  6. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  7. sock.connect((HOST, PORT))
  8. sock.send("Hello World")
  9. data = sock.recv(1024)
  10. sock.close()
  11. print ("Received", repr(data))
  12.  
  13. ---------
  14. ERROR
  15. --------
  16.  
  17. Traceback (most recent call last):
  18.   File "C:\Users\ninja\Desktop\client.py", line 8, in <module>
  19.     sock.send("Hello World")
  20. TypeError: 'str' does not support the buffer interface
RAW Paste Data
Top