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

1234567891011121314151617181920212223
  1. # This is a sample Python script.
  2. # Press ⌃R to execute it or replace it with your code.
  3. # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
  4. import socket
  5. s = socket.socket()
  6. host = socket.gethostname()
  7. port = 12345
  8. s.connect((host, port))
  9. while True:
  10. msg = input('Wort eingeben: ')
  11. if msg != 'STOP':
  12. s.send(msg.encode('utf-8'))
  13. bytes = s.recv(1024)
  14. print(bytes.decode('utf-8'))
  15. else:
  16. break
  17. # See PyCharm help at https://www.jetbrains.com/help/pycharm/