Re: Escape sequences (colour) and padding with "%8s"%

2006-08-10 Thread Anthra Norell
Subject: Escape sequences (colour) and padding with "%8s"% > Hi all! > > I used escape sequences to produce colour output, but a construct like > > print "%8s" % str_with_escape > > doesn't do the right thing. I suppose the padding counts the esc

Re: Escape sequences (colour) and padding with "%8s"%

2006-08-10 Thread Anton81
> If you insist on building the codes yourself instead of using the > standard curses library... > > print '\x1b[34m%8s\x1b[0m' % 'TEST' Will the curses library help? The problem is I need the colour coded in my string and the "print pattern" is static. What's the quickest way to solve this with

Re: Escape sequences (colour) and padding with "%8s"%

2006-08-10 Thread Gabriel Genellina
At Thursday 10/8/2006 07:04, Anton81 wrote: For example: print '%8s' % '\x1b[34mTEST\x1b[0m' doesn't not indent 'TEST' whereas print '%8s' % TEST' works. If you insist on building the codes yourself instead of using the standard curses library... print '\x1b[34m%8s\x1b[0m' % 'TEST' G

Re: Escape sequences (colour) and padding with "%8s"%

2006-08-10 Thread Anton81
For example: print '%8s' % '\x1b[34mTEST\x1b[0m' doesn't not indent 'TEST' whereas print '%8s' % TEST' works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Escape sequences (colour) and padding with "%8s"%

2006-08-09 Thread Tim Chase
> I used escape sequences to produce colour output, but a construct like > > print "%8s" % str_with_escape > > doesn't do the right thing. I suppose the padding counts the escape > characters, too. > > What could be a solution? You omit half of the equation: the contents of str_with_escape.

Escape sequences (colour) and padding with "%8s"%

2006-08-09 Thread Anton81
Hi all! I used escape sequences to produce colour output, but a construct like print "%8s" % str_with_escape doesn't do the right thing. I suppose the padding counts the escape characters, too. What could be a solution? Anton -- http://mail.python.org/mailman/listinfo/python-list