I have two scripts one just asks for input then prints the input. The other one launches the script. It is only half working and I was hoping someone could shed some light on the issue.
import subprocess process = subprocess.Popen('python test2.py', shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None) process.stdin.write("test\r\n".encode('utf-8')) process.stdin.flush() result = process.stdout.readline()[:-2].decode('utf-8') print(result) while result != "": result = process.stdout.readline()[:-2].decode('utf-8') print(result)
s=input("input here:") print(s)
input here:test test