I am a beginner studying Python using VS code.
When I try to change the color with termcolor, it says ?[32mtest?[0m
.
I would appreciate it if someone could tell me.
from termcolor import colored
print('test')
print('test', 'green')
?[0m
is probably the ESC[0m
, which is called the vt100
terminal escape sequence.Unfortunately, the Windows console does not support this vt100
escape sequence, although this is one of the procedures that was commonly used in the past on the "terminal"Therefore, the color of the Windows console looks the same.In short, your settings are for Linux devices (vt100
) and not for Windows consoles.
Use colorama
to color on the Windows console.
https://stackoverflow.com/questions/21858567/
© 2024 OneMinuteCode. All rights reserved.