Formatted Colored Text Output
richiwalt last edited by
Why is formatted colored text out considered invalid syntax ?
print "%d = \033[91m%d\033[0m x %d \033[92m(or %d)\033[0m with a remainder of: %d" % (num1, m, num2, num2*m, r)
Is there something I’m overlooking or is this not supported ?
enceladus last edited by
Not supported. See the discussion
dgelessus last edited by
@richiwalt If you're getting a Python
SyntaxErrorwhen running that code, it's because the code is for Python 2, but Pythonista's default is Python 3. (In Python 3 you need to put parentheses around the arguments for
However in any case Pythonista doesn't support changing the text color using escape sequences - if you try to use them, you'll see the escape sequences printed out with no change in color. If you want to change the console text color in Pythonista, you can use the
set_colorfunction from the