[Python-ideas] Add \e escape code

Andrew Barnert abarnert at yahoo.com
Wed Jun 12 00:41:17 CEST 2013


From: Alexander Belopolsky <alexander.belopolsky at gmail.com>
Sent: Tuesday, June 11, 2013 2:28 PM


>While I wish I could copy my bash ANSI coloring codes directly into python, I can live with the available alternatives.  Consider me +0.


When copying and pasting a big mess of preformatted strings, you generally have to tack a .replace('\\e', '\033') onto the end (or, if it's a list of separate strings, map that over the list). Mildly annoying, but it doesn't come up often enough to be worth changing things.


And for any case _other_ than copying and pasting a big mess of pre-formatted strings into Python code, you're much better off with a library or a format dict (like the one Joshua Landau just posted).

So, I'm -0.


More information about the Python-ideas mailing list