I previously asked a question about how to set up a tkinter gui to recieve lines from a subprocess without the entire program hanging. That is now functional.
Now, I can't figure out how to send new lines to a subprocess. I've tried using process.communicate, but I might have been using it wrong. I also tried this question's solution, but self.process.stdin.write('stop\n'.encode())
doesn't seem to work. How do I send new commands to the child python subprocess?
Relevant code:
self.process = subprocess.Popen([ "python", "-u", dir + "start.py" ],
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=dir)