tomateblue

ClientBigRobot.py

Mar 3rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import socket
  4. import pyautogui
  5.  
  6. TCP_IP = '127.0.0.1'
  7. TCP_PORT = 5005
  8. BUFFER_SIZE = 1024
  9. MESSAGE = " "
  10.  
  11. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  12. s.connect((TCP_IP, TCP_PORT))
  13. while True:
  14.  MESSAGE = pyautogui.confirm(text="CONTROLE BIG ROBOT",title='CONTROLE BIG ROBOT',buttons=["w","s","a","d","p"])
  15.  #MESSAGE = raw_input("\nw - frente\ns - voltar\na - esquerda\nd - direita\np - parar\n=> ")
  16.  s.send(MESSAGE)
  17.  data = s.recv(BUFFER_SIZE)
  18.  
  19. s.close()
  20.  
  21. print "received data:", data
Add Comment
Please, Sign In to add comment