[CLEARIFIED] Change Text Color in Code Playground using Python | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

[CLEARIFIED] Change Text Color in Code Playground using Python

How can I change the text color in Code Playground using Python. I try to write a code but it won't work. In my code I try to create an image with the desired text and color using PIL, then convert the image pixels to ANSI color codes to display it in the playground terminal. But it shows error because of fonts. 𝘐𝘮 đ˜”đ˜©đ˜Šđ˜łđ˜Š 𝘱𝘯đ˜ș 𝘾𝘱đ˜ș 𝘐 đ˜€đ˜ąđ˜Ż đ˜€đ˜©đ˜ąđ˜Żđ˜šđ˜Š đ˜”đ˜©đ˜Š đ˜§đ˜°đ˜Żđ˜” đ˜€đ˜°đ˜­đ˜°đ˜ł đ˜Ș𝘯 đ˜Šđ˜°đ˜„đ˜Š 𝘗𝘭𝘱đ˜șđ˜šđ˜łđ˜°đ˜¶đ˜Żđ˜„ đ˜Ș𝘯 𝘚𝘰𝘭𝘰𝘭𝘩𝘱𝘳𝘯 𝘾đ˜Șđ˜”đ˜© 𝘧đ˜Șđ˜čđ˜Ș𝘯𝘹 𝘼đ˜ș đ˜€đ˜°đ˜„đ˜Š 𝘰𝘳 đ˜Ș𝘮 đ˜”đ˜©đ˜Šđ˜łđ˜Š 𝘱𝘯đ˜ș đ˜ąđ˜­đ˜”đ˜Šđ˜łđ˜Żđ˜ąđ˜”đ˜Șđ˜·đ˜Š 𝘾𝘱đ˜ș đ˜”đ˜° đ˜„đ˜° đ˜”đ˜©đ˜Ș𝘮 đ˜Ș𝘯 𝘗đ˜șđ˜”đ˜©đ˜°đ˜Ż? đ˜›đ˜©đ˜ąđ˜Żđ˜Źđ˜Ž đ˜Ș𝘯 đ˜ąđ˜„đ˜·đ˜ąđ˜Żđ˜€đ˜Š! https://sololearn.com/compiler-playground/cdo6Kv477CH9/?ref=app

13th Apr 2024, 11:31 AM
`ĐœŃ‚Ń‚á‹šâŽâ°â¶
`ĐœŃ‚Ń‚á‹šâŽâ°â¶ - avatar
5 RĂ©ponses
+ 2
I don't believe it's possible with the Sololearn compiler. I know that Oma Falk has done some kind of graphics with the Python compiler. You could check those codes out, see if that's in the right direction.
13th Apr 2024, 2:28 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
ĐœŃ‚Ń‚p⁎⁰⁶ , I've seen a few programs by other people on Sololearn that use a trick that only works on Sololearn to execute some HTML in Python by putting it in a str literal. It fails if you copy it to an external IDE, where it just prints the str literal instead of executing it. I haven't saved links to all of them. Here's one that I did save the link to. It doesn't change the font color, but it does change the background color. You can fiddle with it to try adding the HTML you want. https://sololearn.com/compiler-playground/cK6u3JGHnEqo/?ref=app
13th Apr 2024, 4:33 PM
Rain
Rain - avatar
+ 2
ĐœŃ‚Ń‚p⁎⁰⁶ OK. I found one with red text by David Ashton. (Again, it doesn't work outside of Sololearn.) https://sololearn.com/compiler-playground/cdtdvNxleozG/?ref=app
13th Apr 2024, 4:48 PM
Rain
Rain - avatar
+ 2
Thank Rain
13th Apr 2024, 5:08 PM
`ĐœŃ‚Ń‚á‹šâŽâ°â¶
`ĐœŃ‚Ń‚á‹šâŽâ°â¶ - avatar
+ 1
Ausgrindtube Thank you sir. Let me check 😊
13th Apr 2024, 2:41 PM
`ĐœŃ‚Ń‚á‹šâŽâ°â¶
`ĐœŃ‚Ń‚á‹šâŽâ°â¶ - avatar