how to get output from subprocess.popen(),sys.stdout.flush()