On Fri, 21 Apr 2006 09:30:06 -0500, Nick Craig-Wood wrote:
> robert <[EMAIL PROTECTED]> wrote:
>>  when I run a command
>> 
>>  myapp 2>&1
>
> Try
>
>   myapp 2>&1 | cat
>
> and see what you get.  You should get the same output as the python.
>
>>  #!python
>>  print os.popen("myapp 2>&1").read()
>> 
>>  the stderr stuff comes all after the stdout stuff.
>>  How can I get ahold of all the out and err joined synchronously in the 
>>  order, it is created ?
>
> You need to either
>
> 1) change myapp to fflush() more often
>
> 2) investigate the python pty module to fool the app into thinking it
> is talking to a terminal
[...]

3) write a LD_PRELOAD wrapper that turns isatty() into a
function that returns true if its arg is 1.

4) perl -pi -e 's/isatty/fchdir/g' myapp
   (might not work ;).


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

Reply via email to