diff options
| author | Edvin <[email protected]> | 2025-04-09 13:54:25 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-04-09 13:54:25 +0200 |
| commit | f52ccfbd1644d3059e67c6e04a91b2c275b307f8 (patch) | |
| tree | 968b163202a6731de61178dc31e67709774531a9 /control.py | |
| parent | 59b0200a59969bdbabd3273e5e1de0f325a3fc85 (diff) | |
Two-way communication attempt #2
Diffstat (limited to 'control.py')
| -rw-r--r-- | control.py | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -29,6 +29,7 @@ input = "0" while input != "a": input = get_input() + print("Sending: %s" % input) if input == "i": sock.send("11") elif input == "j": @@ -39,8 +40,20 @@ while input != "a": sock.send("22") else: sock.send("0") - print(input) + + read = sock.recv(1024) + read = read.decode("utf-8").strip('\n') + print("Received: '%s'" % read ) time.sleep(0.1) +print("Sending: %s" % input) +sock.send(input) + +read = sock.recv(1024) +read = read.decode("utf-8").strip('\n') +print("Received: '%s'" % read ) + +print("Shutting down...") + sock.close() |
