I'm using the subprocess module to start a subprocess (java program) and connect to it's output stream (stdout). But when i try to get its stdout there is no output.
p= subprocess.Popen(["java -Xmx256m -jar bin/HelloWorld.jar"],cwd=r'/home/karen/sphinx4-1.0beta5-src/sphinx4-1.0beta5/', shell=True, stdout=subprocess.PIPE, bufsize= 4024)
out, err = p.communicate()
print out
I want to be able to execute non-blocking reads on its stdout too. How can i do both things?