praktikum
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Client.py 375B

123456789101112131415161718192021222324
  1. import socket
  2. SOCKET = socket.socket()
  3. HOST = socket.gethostname()
  4. PORT = 45670
  5. SOCKET.connect((HOST, PORT))
  6. while True:
  7. eingabe = input("Eingabe: ")
  8. msg = eingabe.encode("utf-8")
  9. SOCKET.send(msg)
  10. if eingabe.upper() == "STOP":
  11. SOCKET.close()
  12. break
  13. msg = SOCKET.recv(1024)
  14. msg = msg.decode("utf-8")
  15. print(msg)
  16. SOCKET.close()