Relative Content

Tag Archive for pythonc++python-3.xsubprocesspython-3.8

Why does process.communicate cause my program to be killed?

I’m running some code for a program in python, and when I run c++ I need to handle standard input for my it, such as scanf and cin. I am running the compiled c++ program using subprocess.Popen. I expect it to time out and raise an exception when I don’t give any stdin, but my program ends straight away and prints Killed on the console.
Here’s part of my class, which I believe is sufficient