aboutsummaryrefslogtreecommitdiff
path: root/voerbak/test.py
blob: 8cc1db9387e71d2dd7eac19c44068c731c1f40b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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))