Ask coding questions

← Back to all posts
How do you change text colors and fonts in python?
CreeperBoyKoray

like changing how print statements look like

Answered by 19wintersp [earned 5 cycles]
View Answer
Voters
ch1ck3n
CreeperBoyKoray
Comments
hotnewtop
19wintersp

The way you can change the colour is through the use of escape codes. Here's a full list of them, though the way you use them is to print it, and then all following text will have that attribute. Alternatively, you can use a library such colored, termcolor or colorama to achieve the same effect automatically.

CreeperBoyKoray

@19wintersp thank you!

Bookie0

Check this out.

This is how to make colors in Python.

Pretty simple, just copy paste these colors (because typing them would be to long...)

So to use it, just put the color before the text: