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.

demo_client.py 476B

123456789101112131415161718192021222324
  1. import socket
  2. #eingabe = input("Bitte etwas eingeben:")
  3. s = socket.socket()
  4. host = socket.gethostname()
  5. port = 12346
  6. s.connect((host, port))
  7. #s.connect((host, port))
  8. #s.send(eingabe.encode('utf-8'))
  9. ##bytes = s.recv(1024)
  10. ##print(bytes.decode('utf-8'))
  11. #print('Gesendet')
  12. #msg3 = s.recv(1024)
  13. #print(msg3.decode('utf-8'))
  14. #s.close()
  15. while True:
  16. eingabe = input("Bitte etwas eingeben:")
  17. (connection, addr) = s.accept()
  18. connection.send(eingabe.encode('utf-8'))