Re: preserving color ouput of a shell command via os.popen()

2006-09-26 Thread Gabriel Genellina
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

Re: preserving color ouput of a shell command via os.popen()

2006-09-26 Thread Jean-Paul Calderone
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

Re: preserving color ouput of a shell command via os.popen()

2006-09-26 Thread zeezlo
> 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

Re: preserving color ouput of a shell command via os.popen()

2006-09-26 Thread Brett Hoerner
[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

preserving color ouput of a shell command via os.popen()

2006-09-26 Thread zeezlo
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