[Python] How to print colored or bold text in Python Visual Studio 2022 CLI app

Discussão em 'Python' iniciado por Stack, Março 17, 2025.

  1. Stack

    Stack Membro Participativo

    I have tried colorama, termcolor and printy.
    When I run the application in debug method, the text isn't formatted.

    This wasn't the case, when I built a C# Console application in VS.

    Here is the code using printy.

    from printy import printy

    printy("Hello world", "rBU")


    Output:


    [38;5;196;1;4mHello world[0m
    ​

    [​IMG]

    I have tried a few no-package solutions from here, but no luck. How do I print colored text to the terminal?

    Is there any VS setting to configure?

    Continue reading...

Compartilhe esta Página