Search code examples
textcolorswxpythonwxwidgetsansi-escape

Is there a wx Widget to show ANSI escape code colored text?


I can't seem to find a control that will display text colored with ANSI escape codes. For example:

"\e[0;32mHello \e[0;37mWorld"

Would display a green "Hello" and a white "World".

Does one exist?


Solution

  • I don't think that such a widget exists. You may look for some way of changing ANSI codes into HTML and then displaying it in wxWidgets. This may be useful: http://code.activestate.com/recipes/577349-convert-a-transcript-with-ansi-escape-sequences-to/