At Tuesday 26/9/2006 23:07, [EMAIL PROTECTED] wrote:
I would like to get the output of a shell process on Linux (eg, "ls
--color=auto") run via os.popen(), filter it and then output parts of
it while preserving any original coloring added by that process.
Yes, just omit the =auto (or use --col
On 26 Sep 2006 19:07:54 -0700, [EMAIL PROTECTED] wrote:
>Hi everyone
>
>I would like to get the output of a shell process on Linux (eg, "ls
>--color=auto") run via os.popen(), filter it and then output parts of
>it while preserving any original coloring added by that process.
>
>Doing
>
>child = os
> See the difference? :)
Brett, not only do I see the difference but I actually see it in color,
too! : )
Thanks for your help,
Juerg
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> child = os.popen("ls --color=auto")
> output = child.read()
>
> results in an output string which is free of the escape sequences
> generated by ls.
Don't use --color=auto, from the 'ls' man page:
With --color=auto, color codes are output only if standard output is
co
Hi everyone
I would like to get the output of a shell process on Linux (eg, "ls
--color=auto") run via os.popen(), filter it and then output parts of
it while preserving any original coloring added by that process.
Doing
child = os.popen("ls --color=auto")
output = child.read()
results in an ou