+ 1
Color output in python
Hi SoloLearn Community Recently I saw someone create colored text output in Python - like a blue rectangle made with characters (about 5x10 size). I tried to improve my code using ANSI escape codes (like \033[94m), but they don’t work here on SoloLearn. Also, SoloLearn doesn't seem to have color libraries like colorama or termcolor How can I create colored "art" in SoloLearn’s environment?
2 Respostas
+ 2
OrehekCode as you have found, Sololearn's console does not support ANSI attributes and commands. The technique that I and others uncovered (I was the first) is based on a kluge that Sololearn introduced with their Python for Data Science tutorial. By creating any .png file, it switches the app into html mode so that it may display the graph images used in the course. The .png can just be an empty file, for instance, created with an open statement, or by using the UNIX touch command. A side effect is that any html that your Python program prints to the console gets interpreted as markup for display. Then you may set text color and size attributes, etc.
Here is a simple example:
https://sololearn.com/compiler-playground/cdtdvNxleozG/?ref=app
0
Thank you, this is what I got with your help:
https://sololearn.com/compiler-playground/cm4d1vW6jG07/?ref=app