The problem is as follows:
I have an environment coded in c++, a normal user can interact with this program by reading the state of the environment from the terminal and typing their action in to the terminal.
Now i want to replace the user with a python script that reads the state and makes the action.
How would i go about doing this?
I am guessing something with running both programs on a seperate thread or something, but I am not sure how to go about his.
What i want to do:
<code>// c++ program
int function(){
// print state
// get action
std::cin << action;
}
// python program
def function():
// retrieve state from c++ program
// communicate chosen action to c++ program
</code>
<code>// c++ program
int function(){
// print state
// get action
std::cin << action;
}
// python program
def function():
// retrieve state from c++ program
// communicate chosen action to c++ program
</code>
// c++ program
int function(){
// print state
// get action
std::cin << action;
}
// python program
def function():
// retrieve state from c++ program
// communicate chosen action to c++ program
I have tried pipelining but this did not work properly