Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Formatted Colored Text Output
-
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 ?
-
Not supported. See the discussion
https://forum.omz-software.com/topic/4131/colorama-see-characters-in-color -
@richiwalt If you're getting a Python
SyntaxError
when 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 forprint
, like with any other function. In Python 2,print
is special and doesn't require parentheses.)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_color
function from theconsole
module.