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

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