Paul Lemelle wrote:
JM,

Thanks for the response. I am trying to capture the stdout of a program from another program. Example, I want to launch the below program from a second python script then capture the first's program stdout to a file or variable.

Is this possible?

Thanks again,
Paul


use the subprocess module.

import subprocess
proc = subprocess.Popen(['echo', 'Hello World'], stdout=subprocess.PIPE, stderr=subprocess.PIPE )
out, err = proc.communicate()
print out
>> Hello World


more details here

http://docs.python.org/library/subprocess.html



JM
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to