How do you change the font in Python?
gibbsfreenergy

How do you change the font in Python? Would be pretty cool to learn this.

You are viewing a single comment. View All
Answered by adl212 [earned 5 cycles]
View Answer
adl212

Unfortunately, you can not change the font family of text in python. But, you can change the color of the text or add markdown to the text. Hope this answers your question! Upvote or choose as the correct answer if so.

adl212

@JosephSanthosh The ANSI color codes are

Just add them to your print function and it will change the text!

gibbsfreenergy

@adl212 thx, but is there any other way I can decorate the text even more besides colors?

adl212

@JosephSanthosh You can use bold, underline, and etc.

gibbsfreenergy

do u know what or where the codes are? @adl212

gibbsfreenergy

how do i write it inside a print() [email protected]

adl212

@JosephSanthosh You would do something like print("\033[1m" + "This is bold text!" + "\033[0m")Hope this helps!

gibbsfreenergy

never mind I found out. [email protected]

Coder100

there's more... @adl212

adl212

@Coder100 Ok, go ahead and tell us!

Coder100

alright, there's also rgb support:

and 8bit (256 colors):

@adl212

gibbsfreenergy

there are 256 [email protected]

adl212

@Coder100 Ok, great! I didn't know of these!

Coder100

:) glad to introduce ya @adl212

gibbsfreenergy

thanks guys @Coder100 @adl212

Coder100
adl212

@JosephSanthosh No problem!