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() |
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() |