Blame view

Python/client.py 356 Bytes
cdb865f1   lwadbled   feat(Python): Ajo...
1
  import socket
da5d2b56   lwadbled   feat(Matrice): pe...
2
  import sys
cdb865f1   lwadbled   feat(Python): Ajo...
3
4
  
  if __name__ == '__main__':
ceef8241   lwadbled   fix(Python): Comm...
5
  	# TODO : Prendre en arguments les donnees et l'adresse de la RPi
cdb865f1   lwadbled   feat(Python): Ajo...
6
  	clientSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM);
da5d2b56   lwadbled   feat(Matrice): pe...
7
8
  	data = sys.argv[2];
  	clientSocket.sendto(data.encode(),(sys.argv[1],9090));
cdb865f1   lwadbled   feat(Python): Ajo...
9
10
  	dataFromServer,sourceAddress = clientSocket.recvfrom(1024);
  	print(dataFromServer.decode());