On Jul 1, 12:42 am, Nobody <nob...@nowhere.com> wrote: > On Wed, 30 Jun 2010 21:12:12 -0700, m wrote: > > If I add the line: > > for l in line: print ord(l),'\t',l > > after the first readline, I get the following: > > > 27 > > 91 [ > > 48 0 > > 48 0 > > 109 m > > 27 > > 91 [ > > 51 3 > > 55 7 > > 109 m > > > before the codes begin for the string as it appears if I just print > > it. So, what is this sequence? They seem like some sort of escape > > codes, I've never seen this before at all. > > <ESC>[00m is the ANSI code to reset attributes to their default state. > <ESC>[37m is the ANSI code to set the foreground color to white. > > > Can anyone enlighten me as to what is going on? > > > And, can I safely strip sets of 5 characters from the front as long as > > they start with Escape (27)? > > No, escape sequences can be of arbitrary length. >
It turned out that make was aliased to colourmake, and the escape codes were being put in there for beautifying the console output. Sorry to bother everyone. -- http://mail.python.org/mailman/listinfo/python-list