Jun-16-2019, 05:35 AM
Hi there ,
I am using python 3.6 version. I have main python script which calls other python scripts, those internal scripts prompts for several user inputs. I wish to run those and then send the user input to the parent process and also send the result.
Note that the internal script has a lot of output, I don't want to take it all, but only the user input. Till now I wrote this info to a file and read it in the parent. But I am searching for a better elegant way which will allow me using any script as a black box and capturing its input and result without changing the inside script).
(At first I used os.system, check_output, call, popen also used PIPE, but could not capture it in a way the internal script continues, being completed and return all input to the user, it has several inputs in each script, till now it froze after the first or did not print the output, did not understand why).
I will appreciate if you can add code example of this and explains how can I implement that.
Please advice,
Thank you ,
Limor
I am using python 3.6 version. I have main python script which calls other python scripts, those internal scripts prompts for several user inputs. I wish to run those and then send the user input to the parent process and also send the result.
Note that the internal script has a lot of output, I don't want to take it all, but only the user input. Till now I wrote this info to a file and read it in the parent. But I am searching for a better elegant way which will allow me using any script as a black box and capturing its input and result without changing the inside script).
(At first I used os.system, check_output, call, popen also used PIPE, but could not capture it in a way the internal script continues, being completed and return all input to the user, it has several inputs in each script, till now it froze after the first or did not print the output, did not understand why).
I will appreciate if you can add code example of this and explains how can I implement that.
Please advice,
Thank you ,
Limor