Ask coding questions

← Back to all posts
Changing font
C00lguy975

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 [earned 5 cycles]
View Answer
Voters
skyzzz1
RichardQuizphil
Omar-AinunAinun
OrelebeletseM
RadhikaG16
SagarNivargi
HarshitPatil3
lolguineapig
Aravind2008
rknetizen
Comments
hotnewtop
mat1

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

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

Vandesm14

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

Geocube101

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

C00lguy975

@Geocube101 Apparently you can't :(

AlfieCijoy

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

AllAwesome497

What?