ANSI in Visual Studio Code with Python

Asked

Viewed 146 times

2

How do I make vs code understand this command line:

print('\033[1mNome: ')

Where " 033[1m" is the part responsible for leaving in bold, but instead it is responding with this:

?[1mNome:

1 answer

3

On windows terminals, ansi sequence support is not enabled.

The easiest way to make it work is to import the outsourced library "Colorama" (pip install colorama), and, at the beginning of your program, put the lines:

import colorama
colorama.init()

Yesterday I commented a little more on the same subject in this other reply: How to change numbers on the same Python runline?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.