How to get colored output in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

How to get colored output in python?

3rd Aug 2018, 6:47 AM
Crystal!!!😎
Crystal!!!😎 - avatar
19 Answers
+ 12
if any complier showing coloured output like stickers as kuba codes there is some way to get but we are not that level trained programmers and the another problem is this playground handling by sololearn we can't modify there so might very much difficult
4th Aug 2018, 8:26 AM
Charan Leo25
Charan Leo25 - avatar
+ 8
Paul Grasser we can't use colour output but there is way we can do are you interested
4th Aug 2018, 6:38 AM
Charan Leo25
Charan Leo25 - avatar
+ 7
u can
4th Aug 2018, 7:18 AM
Charan Leo25
Charan Leo25 - avatar
+ 7
thanks Basel Akasha 😊😊
4th Aug 2018, 8:52 AM
Crystal!!!😎
Crystal!!!😎 - avatar
+ 6
3rd Aug 2018, 6:59 AM
Paul Grasser
Paul Grasser - avatar
+ 4
Basel's answer.
3rd Aug 2018, 11:22 PM
Zoki Kuzmanovski
Zoki Kuzmanovski - avatar
+ 4
how?
4th Aug 2018, 8:22 AM
Crystal!!!😎
Crystal!!!😎 - avatar
+ 4
also possible in sololearn?
4th Aug 2018, 8:25 AM
Crystal!!!😎
Crystal!!!😎 - avatar
+ 4
ok
4th Aug 2018, 8:26 AM
Crystal!!!😎
Crystal!!!😎 - avatar
+ 4
ohh!
4th Aug 2018, 8:30 AM
Crystal!!!😎
Crystal!!!😎 - avatar
+ 4
add print("/033[dm TEXT HERE /033[0m") in the beginning, d can be any number from 30 to 37
4th Aug 2018, 4:10 PM
Julian
Julian - avatar
+ 3
HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' print WARNING + "Error ! " +ENDC ### You cant use them in sololearn app
3rd Aug 2018, 6:59 AM
Basel Akasha
+ 2
Charan LEo25 Yes we can, just not here in SL.
4th Aug 2018, 7:10 AM
Paul Grasser
Paul Grasser - avatar
+ 2
Use my code I linked above, and do print(red("Red Text")) Instead of red u can do all other colors defined.
4th Aug 2018, 8:24 AM
Paul Grasser
Paul Grasser - avatar
+ 2
See this picture in this post : https://www.sololearn.com/post/21671/?ref=app
4th Aug 2018, 8:46 AM
Basel Akasha
+ 2
Crystal!! Welcome!
4th Aug 2018, 8:52 AM
Basel Akasha
+ 2
As my first language in Java, I found more easier to do colours in Python :)
5th Aug 2018, 5:50 AM
Oleksandra Kovalenko
Oleksandra Kovalenko - avatar
+ 2
These days I'm learning tkinter and I think it's easy and best for at least basics.
6th Sep 2018, 3:41 PM
Шащи Ранжан
Шащи Ранжан - avatar