1
$\begingroup$

I prefer using the Python Console Editor over System Console.
In System Console you can print colored text with ANSI escape sequences (I learned this via https://stackoverflow.com/questions/287871/how-to-print-colored-text-to-the-terminal).
For example, the 2 lines below print "Colored text" in red in the System Console:

CSI = "\x1B["
print(CSI+"31;40m" + "Colored Text" + CSI + "0m")

How do I make this work in python console?
Thanks in advance

$\endgroup$
2
  • 1
    $\begingroup$ IIRC this has been asked before and it is not possible. Can print in red (error color) with bpy.ops.console.scrollback_append(text="Coloured Text", type='ERROR') (4 choices output , input, info, error) Somewhat Related blender.stackexchange.com/questions/93728/… $\endgroup$
    – batFINGER
    Commented May 20, 2021 at 12:05
  • $\begingroup$ Try using something such as IDLE, eDEX-UI, or Geany. $\endgroup$
    – TheLabCat
    Commented May 20, 2021 at 20:38

0

You must log in to answer this question.

Browse other questions tagged .