popen4 not returning output

James Stroud jstroud at mbi.ucla.edu
Mon Aug 20 00:42:19 EDT 2007


James Stroud wrote:
> hortitude at gmail.com wrote:
>> I am trying to run the following script:
>>
>>
>> #!/usr/bin/python
>>
>> import popen2
>>
>> commandToRun = """scp scp_trial.py user at host:/targetDirectory"""
>> #commandToRun = "ls"
>> print commandToRun
>> p_out, p_in = popen2.popen4 (commandToRun)
>>
>> theOut = p_out.readlines ()
>> print theOut
>>
>>
>> When I run this command with the "ls" command I see the output.
>> When I run this with the scp command I do not see the output of my
>> command -- however the file is successfully transfered.  How can I see
>> the output?
>>
>> Thanks
>>
> 
> I'm not up on my scp, but look at popen3 and read from err.
> 
> James

Nevermind, I didn't notice that you were using popen4.



More information about the Python-list mailing list