[Python] How to color text more efficiently?

Discussão em 'Python' iniciado por Stack, Novembro 30, 2025.

  1. Stack

    Stack Membro Participativo

    So I know how to color text, I am using a class to define colors and then using that in a print statements -

    class color:
    purple = '\033[95m'
    cyan = '\033[96m'
    darkcyan = '\033[36m'
    blue = '\033[94m'
    green = '\033[92m'
    yellow = '\033[93m'
    end = '\033[0m'

    print(color.green + "This makes the text green!" + color.end)


    But I am working on a project for CSE class and there will be lots of text to read, and eventually all the whites just blend together, so using colored text makes things easier. I was wondering if there was an easier, less time consuming, way of doing things?

    Continue reading...

Compartilhe esta Página