Capturing output into a python script from another python script with subprocess
问题 This is running on Windows Vista Home 32b with Service Pack 2 I am actively testing it on Mac, and Linux I have one python script [A] that uses subprocess to run another python script [B] process = subprocess.Popen(action, stdin=subprocess.PIPE, stdout=subprocess.PIPE, bufsize=-1) out = process.stdout.readline() print out I use [A] to run [B] [B] comes from the command line, so can be any script what so ever when [B] is a the following python script #file = 'bufftest.py" msg = "X" x = 1024 y