Python 3 yachalk Script to Style Your Terminal Output With Colors & Underline
439 views
Jun 3, 2025
Get the full source code of application here:
View Video Transcript
0:00
uh hello guys welcome to this video so
0:02
in this video I will show you a Python
0:05
module which can actually style your
0:08
terminal output with colors and
0:11
underline so if you are building some
0:13
kind of a terminal application inside
0:15
Python this can significantly improve
0:18
the readability of your terminal let me
0:21
show you the example right here if I
0:23
execute this script here you will see
0:25
you can have output inside your terminal
0:28
in different colors you can highlight
0:30
your output by having a background color
0:33
you can change the text
0:35
color with these different colors you
0:38
can underline you can make the text bold
0:42
capitalize the text so there is this uh
0:45
package here in it's an open-source
0:47
package inside Python if you search for
0:52
this it's called as y chalk this is
0:55
actually the package
0:59
uh y w a y a cj this is the package here
1:05
so with the help of this package you can
1:07
style your terminal
1:09
output with different colors right here
1:12
so once you install this let me show you
1:14
how to do this so first of all you need
1:17
to import this
1:19
package and from this you just need to
1:21
import the chalk method and then if you
1:25
want to print something on the
1:27
console by default if you print this you
1:30
will see the basic output will be in
1:33
black and white color which is by
1:36
default so if you run the script now you
1:38
will see the hello world will be printed
1:40
out like this but if you want to change
1:43
the styling right here you can actually
1:45
use this module and uh it contains this
1:50
uh all these colors you can use let's
1:53
suppose I want the output to be in blue
1:57
color and now the same hello world
1:59
message will now be appearing in the
2:02
blue color instead of the you will see
2:05
that so this is the very basic thing
2:09
about this package you can style your
2:12
terminal you can combine different
2:15
colors now you can see we are using blue
2:18
and red color in combination and you can
2:21
see that so you can style each and
2:24
everything about your terminal output
2:26
like this
2:28
so you can compose multiple lines as
2:31
well so if you have multiple lines you
2:33
can even write like this so you will see
2:36
that it will appear like
2:43
this and if you have numeric input if
2:46
you want to print out numbers you can do
2:49
like this you can
2:52
bold you can capitalize certain words
2:55
you can highlight them with background
2:56
color everything is there so you can
2:59
check out this module and their
3:00
documentation it's great and also we can
3:03
underline text as well by using this
3:06
underline
3:07
method so you can see we have
3:10
this underline method for every
3:14
color
3:17
underline and then we can use whichever
3:21
color
3:23
combination so for each color
3:25
combination there is a specific method
3:27
inside this module so you can use
3:36
this so this is actually the package
3:38
guys you can check out their talks and
3:41
read more about it thank you very much
3:44
for watching this video and also check
3:46
out my website freemediatools.com
3:49
uh which contains thousands of tools
#Programming
#Scripting Languages
#Skins
# Themes & Wallpapers
#Software