The problem I have is as follows, and I will use simple example to illustrate it. I have written a python script that requires user interaction, specifically it uses the ra
You can only call communicate once. Therefore you need to pass all the input at once, i.e. child.communicate("1\n1\n"). Alternatively you can write to stdin: