python - Subprocess.Popen stdin in new console -


i want execute python subprocess in new console. once started, want user able answer questions asked new process on stdin.

i tried following code:

p = subprocess.popen(cmd, stdin=subprocess.pipe, stdout=subprocess.pipe, stderr=subprocess.pipe, cwd=cwd, creationflags=subprocess.create_new_console) (o, e) = p.communicate() 

as subprocess asks input on stdin following error message displayed:

eoferror: eof when reading line

is way achieve ?

as i'm not interested in stdout/stderr redirection, tried way:

subprocess.popen(cmd, cwd=cwd, creationflags=subprocess.create_new_console)

it works fine now. guess it's not compatible redirect standard input/outputs , create new console.


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -