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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -