🐍 Python Text Styles 🐍 [UPDATED!]
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")
So, add the \033[ first.
After that, add either 0,1,2,3 or 4.
0: Normal text
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
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.
My favorte, light blue: 94
Still not working.
Add a m after the number for your color.
e.g. "\033[1;36mColored text"
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.
I already know most of these but it’s one of the things I always suggest to people and it’s just what every python repl needs!!! It’s not toooooo coding related but nice job!!!