Ask coding questions

← Back to all posts
Changing font
C00lguy975 (23)

I'm making chess AI using the python chess module. I'm doing well, but it's hard to read the board as the font I'm using makes it hard to tell the difference between P and p. How can I change the font in the console?

Answered by mat1 (4428) [earned 5 cycles]
View Answer
mat1 (4428)

You can't change the actual font in the terminal. You can however change the color, and make it bold or italics. This is possible with ANSI escape sequences. For example, if you want to make it bold, print \033[1m. Then if you want to make it bright red use \033[91m. There's a full list of colors in that same Wikipedia article. Finally, you can clear the color, boldness, etc, by simply printing \033[m.

PlatonicC (0)

But the font I had was times New Roman, but in another project imported from GitHub, the font was different. Why is this?

Vandesm14 (2737)

You cannot change the font of the console in

Geocube101 (627)

Can you link the repl?
I didn't even know you could change the font

AlfieCijoy (0)

LOl you can't that's what he is saying @Geocube101