Storing Subprocess Results

Wojtek Walczak gminick at bzt.bzt
Tue Sep 2 16:30:10 CEST 2008

On Tue, 2 Sep 2008 07:16:21 -0700 (PDT), topazcode wrote:
> I am using the subprocess module to run some shell commands on a Linux
> system:
> import subprocess
> output ='''ssh server1 "uptime"''', shell=True)
> The above assigns the output variable with a return code, i.e. 0 in
> this case.  How can I actually capture the data returned from
>, rather than just the return code?

Use subprocess.Popen instead of call.

Wojtek Walczak,

More information about the Python-list mailing list