Ask coding questions

← Back to all posts
Changing font
C00lguy975 (18)

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 (3509) [earned 5 cycles]
View Answer
Commentshotnewtop
mat1 (3509)

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.

Vandesm14 (2556)

You cannot change the font of the console in repl.it

Geocube101 (606)

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

C00lguy975 (18)

@Geocube101 Apparently you can't :(

AlfieCijoy (0)

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