#!/usr/bin/env python # -*- coding: utf-8 -*- import socket hote = "192.168.2.3" port = 12345 connection_with_raspoid = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connection_with_raspoid.connect((hote, port)) print("Connection established with Raspoid; on the port {}".format(port)) message_to_send = b"" while message_to_send != b"sstop": message_to_send = raw_input("> ") message_to_send = message_to_send.encode() connection_with_raspoid.send(message_to_send) #msg_recu = connexion_avec_serveur.recv(1024) #print(msg_recu.decode()) # Là encore, peut planter s'il y a des accents print("Connection closed") connection_with_raspoid.close()