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