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

1234567891011121314151617181920212223
  1. import socket
  2. s = socket.socket()
  3. host = socket.gethostbyname('localhost')
  4. port = 64432
  5. s.connect((host,port))
  6. #msg = input(' ')
  7. #byte = s.send(msg.encode('utf-8'))
  8. #recievemsg = s.recv(1024)
  9. #print(recievemsg.decode('utf-8'))
  10. #s.close()
  11. message = 'hi'
  12. while message != 'STOP':
  13. message = input('eingabe: ')
  14. s.send(message.encode('utf-8'))
  15. bytes = s.recv(4096)
  16. print(bytes.decode('utf-8'))
  17. else:
  18. s.close()