Attempting to parse free-form ANSI text.
Michael B. Trausch
mike$#at^&nospam!%trauschus
Mon Oct 23 18:03:00 EDT 2006
Jean-Paul Calderone wrote:
> On Sun, 22 Oct 2006 00:34:14 -0400, "Michael B. Trausch"
> <mike$#at^&nospam!%trauschus at bag.python.org> wrote:
>> Alright... I am attempting to find a way to parse ANSI text from a
>> telnet application. However, I am experiencing a bit of trouble.
>>
>> What I want to do is have all ANSI sequences _removed_ from the output,
>> save for those that manage color codes or text presentation (in short,
>> the ones that are ESC[#m (with additional #s separated by ; characters).
>> The ones that are left, the ones that are the color codes, I want to
>> act on, and remove from the text stream, and display the text.
>
> http://originalgamer.cvs.sourceforge.net/originalgamer/originalgamer/originalgamer/ansi.py?revision=1.12&view=markup
> may be of some interest.
>
I am attempting to study this code to see how it does it. From what I
can see of this thread, it appears to be one of many solutions.
Unfortunately, I am not well-versed in this whole application
programming thing... <g>. I can do simple things, and am good at web
apps, but this style of things is quite new for me.
Anyway, we'll see what I can get out of that, and maybe I can find the
solution. Thanks for the pointer!
-- Mike
More information about the Python-list
mailing list