import socket
import sys

# Prepare 3-byte control message for transmission
TCP_IP = '127.0.0.1'
TCP_PORT = 8000
BUFFER_SIZE = 80

# sys.argv into String to be sended as message
list = sys.argv
list.pop(0)
message = ' '.join(list)

# message = '--help'
# message = '-p "Ceci est une phrase de test" fr'

# Open socket, send message, close socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(message.encode('utf-8'))
#data = s.recv(BUFFER_SIZE)
s.close()
