How can I return a value of an python child process, which I have started through the main.py by following code:
subprocess.check_output(['lxterminal -e python3 rfid_input.py'], stdin=subprocess.PIPE, shell=True, close_fds=True)
parent process:
import sys, subprocess
value = subprocess.check_output(['lxterminal -e python3 rfid_input.py'], stdin=subprocess.PIPE, shell=True, close_fds=True)
print(value)
The child process contains a simple x=input() and looks like following:
import sys
x=input()
sys.stdout.write(x)
but Ii still receive nothing else as the empty b''.
I also tried it by subprocess.Popen with .wait() and .communicate() with no success.
If you have any other ideas how I can get the value of the lxterminal input, please let me know.