🐍 Python Text Styles 🐍 [UPDATED!]
SilvermoonCat (458)

Python Text Styles!

Today we're going to learn:

  • italic, bold, underline
  • all the colors (I know)

Alright! Let's begin:

print("Welcome to python text style tutorials.")

How do we make that text prettier?

First, let's add color

To add color, you can import it. However, a fancier way can be used (I prefer this way).

print("\033[0;36mblue text :D")

WWHHAAT?

So, add the \033[ first.
After that, add either 0,1,2,3 or 4.
0: Normal text
1: Bold
2: Pale
3: Italic
4: Underline

psst: TIPS!
If you are doing let's say pale then bold,
Make sure to do \033[0;1;39m (You can change
the color, of course) But please remember to
clarify it's not pale anymore-
With the 0. Or else... dun dun dun

Alright. Now add that, and we have

print("\033[1;Colored text")

You run the code.

Er, it's not working

Right. We must add the color. Go to main.py to see more, but you can also stay here.
Red: 31
Orange: 33
Yellow: 93
Green: 32
Cyan: 36
My favorte, light blue: 94
Blue: 34
Purple: 35
Gray: 37
White: 39

print("\033[1;36Colored text)

Still not working.

Add a m after the number for your color.
e.g. "\033[1;36mColored text"

phew!

also: Here’s a easy shortcut!
You can list them out: e.g.
cyan = "\033[1;36m" white = "\033[1;39m" reset = "\033[0m"
then use them like:
print(cyan + "Cyan text" + reset)
Should be working now, have fun using the colors! If you discover any new colors or have any questions, comment here.

You are viewing a single comment. View All
SilvermoonCat (458)

@ZhongRietveld I don’t think so but I’m not like a python color expert or smth so maybe you could search it up? I really wish they would allow RGB colors or hex codes. If you find anything interesting you can tell me!!