From cf004f2950478464409228af347ec60d55fb2a9b Mon Sep 17 00:00:00 2001 From: holzschuhke56905 Date: Tue, 15 Oct 2019 14:46:38 +0200 Subject: [PATCH] Version_1 --- Client.py | 19 +++++++++++++++++++ Server.py | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Client.py create mode 100644 Server.py diff --git a/Client.py b/Client.py new file mode 100644 index 0000000..61985ac --- /dev/null +++ b/Client.py @@ -0,0 +1,19 @@ +import socket + +SOCKET = socket.socket() +HOST = socket.gethostname() +PORT = 45677 + + + +# Eingabe +eingabe = input("Eingabe: ") + +# Verbindung zum Server +SOCKET.connect((HOST, PORT)) + +SOCKET.send(eingabe.encode("utf-8")) + + + +SOCKET.close() \ No newline at end of file diff --git a/Server.py b/Server.py new file mode 100644 index 0000000..7470f4d --- /dev/null +++ b/Server.py @@ -0,0 +1,19 @@ +import socket + +SOCKET = socket.socket() +HOST = socket.gethostname() +PORT = 45677 + + +SOCKET.bind((HOST, PORT)) +SOCKET.listen() + + + +(connection, addr) = SOCKET.accept() + +eingabe = connection.recv(1024) +print(eingabe.decode) + + +SOCKET.close() \ No newline at end of file