I am going to connect two scripts, one of which is a python file and the other a PHP file. Let's say the python file looks like such as what follows:
python_file.py
first_input = input("First input: ")
second_input = input("Second input: ")
By running python3 python_file.py through the command prompt, there would be something like:
First input: 1
Second input: 2
But the thing is, I want to read the inputs' text, i.e., "First input: " and "Second input: ", through a PHP script and answer to these inputs proportionally.
One can simply use system("python3 python_file.py '1' '2'"); but that's not what I'm looking for. The thing is, I am going to send input 1 first, and after that, the PHP file is terminated, send the second input, which is 2. Note that it is not known when precisely the second input will be sent. So, some functions such as sleep won't be helpful. Is this possible? If so, how can I do this?
Any help is sincerely appreciated.