[CLEARIFIED] Change Text Color in Code Playground using Python | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
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 Respostas
+ 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