Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import socket
  2.  
  3. ADDRESS = '127.0.0.1'
  4. PORT = 7777
  5.  
  6. with socket.socket() as s:
  7. s.bind((ADDRESS, PORT))
  8. s.listen(1)
  9. connectionObject, address = s.accept()
  10. connectionObject.sendall(b'Hello, World!')
  11. while True:
  12. with connectionObject:
  13. data = connectionObject.recv(1024)
  14. print(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement