How to print colors in the terminal | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to print colors in the terminal

I can't find a way to make my text colored in the terminal. I tried ANSI, and colorama, but it didn't work! Please help,

4th May 2017, 9:26 AM
Shadman Chowdhury
Shadman Chowdhury - avatar
2 Answers
+ 4
Not all terminals are color compatible ( or default turned on, as suggest @Thanh Le... ) and sololearn code playground terminal emulator should not support them ^^
4th May 2017, 2:56 PM
visph
visph - avatar
+ 3
Have you turned on the colors in the terminal? If not: Open ~/.bashrc in text editor and uncomment line: #force_color_prompt=yes to be: force_color_prompt=yes save then execute source ~/.bashrc https://askubuntu.com/questions/517677/how-to-get-a-colored-bash
4th May 2017, 9:29 AM
Thanh Le
Thanh Le - avatar