import time import numpy as np import subprocess from pathlib import Path p = subprocess.Popen(Path("bin", "x64", "Debug", "LivePlotter.exe"), stdin=subprocess.PIPE) x = 0 y = 0 z = 0 t = 0 period = 0.1 while True: time.sleep(period) x = 10*np.cos(t) y = 10*np.sin(t) z = 0 t += period p.stdin.write(f"test {x} {y} {z}\n".encode("utf8")) p.stdin.write(f"test2 {x} {-y} {z}\n".encode("utf8")) p.stdin.write(f"test3 {-x} {y} {z}\n".encode("utf8")) p.stdin.write(f"test4 {-x} {-y} {z}\n".encode("utf8")) p.stdin.flush()