diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-02-16 12:59:45 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-02-16 12:59:45 +0100 |
commit | 1200fd15d5a110b15c16a333936bd3c74f90cbca (patch) | |
tree | bda82a026b57ecca81552787db49ce729f45671c /console/test.py | |
parent | b711f63c4087b3a9f5617af5b55afe93f414ddf5 (diff) |
semi-working voerbak_connector.py
Diffstat (limited to 'console/test.py')
-rw-r--r-- | console/test.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/console/test.py b/console/test.py new file mode 100644 index 0000000..8cc1db9 --- /dev/null +++ b/console/test.py @@ -0,0 +1,24 @@ +import subprocess + +w = 7 +h = 6 +column = 3 + +process = subprocess.Popen(["./voerbak"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=None) + +process.stdin.write(bytearray(f"{w} {h}\n", "utf-8")) +process.stdin.flush() + +process.stdin.write(bytearray(f"{column}\n", "utf-8")) +process.stdin.flush() + +# process.stdin.write(b"0\n") +# process.stdin.flush() +# for c in iter(lambda: process.stdout.read(1), b''): +# sys.stdout.write(c) + +print(process.stdout.readlines(5)) + |