Passe les parametres en arguments

This commit is contained in:
Fred Z 2018-02-24 21:54:45 +01:00
parent 9640cd143c
commit a825bb2712
1 changed files with 10 additions and 3 deletions

View File

@ -6,10 +6,17 @@ client.py
Networking test, client-server talking script
"""
import socket
import socket, sys
MSG_ARG_ERROR = "Usage: client.py hostname port"
if len(sys.argv) < 3:
print(MSG_ARG_ERROR)
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
HOST = "localhost"
PORT = 12800
RECV_BUFFER = 1024
MSG_SERVER_CONNECTED = "Serveur connecté @{}:{}"