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.

prakt1_socket_client 279B

12345678910111213141516
  1. import socket
  2. s = socket.socket()
  3. host = socket.gethostname()
  4. port = 21345
  5. s.connect((host, port))
  6. bytes = s.recv(1024)
  7. print(bytes.decode('utf-8'))
  8. msg = input('Hier Eingabe: ')
  9. msg = msg.encode('utf-8')
  10. s.send(msg)
  11. bytes = s.recv(1024)
  12. print(bytes.decode('utf-8'))
  13. s.close()