Guest User

Untitled

a guest
Jun 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. # activeActor.py (client)
  2.  
  3. import socket
  4. import sys
  5.  
  6. class API:
  7. def __init__(self):
  8. pass
  9. def addData(self,payLoad):
  10. with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
  11. s.connect(("localhost", 118))
  12. s.sendall(b'0'+str.encode(payLoad))
  13. s.recv(1024)
  14.  
  15. server = API()
  16.  
  17. while(True):
  18. pl = input()
  19. if( pl == "bonkers"):
  20. break
  21. else:
  22. server.addData(pl)
  23.  
  24. server.socket.close()
Add Comment
Please, Sign In to add comment