Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>sys.stdout is the python's idea of the parent's output stream.</p> <p>In any case you want to change the child's output stream.</p> <p>subprocess.call and subprocess.Popen take named parameters for the output streams.</p> <p>So open the file you want to output to and then pass that as the appropriate argument to subprocess.</p> <pre><code>f = open("outputFile","wb") subprocess.call(argsArray,stdout=f) </code></pre> <p>Your talk of using <code>&gt;&gt;</code> suggest you are using shell=True, or think you are passing your arguments to the shell. In any case it is better to use the array form of subprocess, which avoid an unnecessary process, and any weirdness from the shell.</p> <p>EDIT:</p> <p>So I downloaded RTMPDump and tried it out, it would appear the messages are appearing on stderr.</p> <p>So with the following program, nothing appears on the programs output, and the rtmpdump logs when into the stderr.txt file:</p> <pre><code>#!/usr/bin/env python import os import subprocess RTMPDUMP="./rtmpdump" assert os.path.isfile(RTMPDUMP) command = [RTMPDUMP,'-r','rtmp://oxy.videolectures.net/video/', '-y','2007/pascal/bootcamp07_vilanova/keller_mikaela/bootcamp07_keller_bss_01', '-a','video','-s', 'http://media.videolectures.net/jw-player/player.swf', '-w','ffa4f0c469cfbe1f449ec42462e8c3ba16600f5a4b311980bb626893ca81f388' ,'-x','53910','-o','test.flv'] stdout = open("stdout.txt","wb") stderr = open("stderr.txt","wb") subprocess.call(command,stdout=stdout,stderr=stderr) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload