From 775ce391d54336f1e40285e328500a38c0b528df Mon Sep 17 00:00:00 2001 From: herrerahuezoul67409 Date: Tue, 15 Oct 2019 15:20:14 +0200 Subject: [PATCH] erster commit --- client.py | 14 ++++++++++++++ server.py | 11 +++++++++++ 2 files changed, 25 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..23ca4f6 --- /dev/null +++ b/client.py @@ -0,0 +1,14 @@ +import socket + +s = socket.socket() +host = socket.gethostname() +port = 12345 +s.bind((host,port)) +s.listen() + +while True: + (connection, addr) = s.accept() + print("Verdindung von", addr) + msg= "Danke für ds vorbeischauen" + connection.send(msg.encode('utf-8')) + connection.close() \ No newline at end of file diff --git a/server.py b/server.py new file mode 100644 index 0000000..48b27f5 --- /dev/null +++ b/server.py @@ -0,0 +1,11 @@ +import socket + +s = socket.socket() +host = socket.gethostname() +port = 12345 +#eingabe = "hello" + +s.connect((host, port)) +bytes = s.recv(1024) +print(bytes.decode('utf-8')) +s.close() \ No newline at end of file