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 403B

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