IDLE not outputting color text [Ubuntu 22, IDLE 3.10.12, sty]

34 Views Asked by At

I've been trying to get into programming in python recently, using IDLE. Now I want to play around with differently colored text output, using the sty module. (After a bit of research it seems to be the simplest way to do what I want)

Unfortunately, when I actually try it out, I don't get different colored text, but the output below. I only recognize this symbol from missing characters.

Using the examples from https://sty.mewo.dev/docs/coloring.html , I get:

Coloring by name:

[94mI have a light blue foreground.[39m
[46mI have a cyan background[49m
[38;5;88m[101mI have a dark red fg and light red bg.[0m
[33mI have yellow fg.[39m

Coloring with 8-bit codes:

[38;5;34mI have a green foreground.[39m
[48;5;133mI have a pink background[49m
[38;5;226m[48;5;19mI have a light yellow fg and dark blue bg.[0m

Coloring with 24bit codes:

[38;2;10;255;10mI have a green foreground.[39m
[48;2;255;150;50mI have an orange background[49m
[38;2;90;90;90m[48;2;32;32;32mGrey fg and dark grey bg.[0m

All printed in the default color.

Edit: evidently the symbol for missing characters didn't survive posting this message. What I'm talking about looks a bit like a circle with notches in the top left, top right, bottom left, and bottom right. I hope you get what I mean. It shows up right in front of each [ in my output.

Edit2: I've just tried using colorama instead, but I get a similar result.

0

There are 0 best solutions below