Eryk Sun added the comment:
Interactive mode isn't automatically enabled when stdin isn't a tty, so the
interpreter tries to read all of stdin, until the result is empty (i.e. EOF).
You can force interactive mode with the -i command-line option. The example
would also benefit from passing
New submission from DJ PJs :
Keeping writing to a subprocess, and then flushing it to get the stdout works
for other interpreters, but not python's.
Simplified Example of what I mean:
from subprocess import PIPE, Popen, CREATE_NEW_CONSOLE, run
subProcess = Popen("Python", stdin=PIPE,