I want to run my command and capture stdout realtime:
import subprocess
import shlex
cmd='my command'
args=shlex.split(cmd)
com=subprocess.Popen(args,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
com.stdout.flush()
for line in com.stdout.read()
print line
But there is nothing as output...