Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bcc0d9a

Browse files
Create README.md
1 parent 263af6b commit bcc0d9a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎Colored Text/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Print Colored Text with Python🔥
2+
3+
In Python the Colorama module allows us to easily create colored terminal text and I will take you through a tutorial on how to print Colored Text with Python by using the Colorama module in Python.
4+
5+
## 📌What is Colorama in Python?
6+
Using the Colorama module we can print colored text with Python. We can use it and call its built-in variables which are aliases for the desired ANSI codes. This makes our code more readable and works better with Windows command prompts after calling colorama.init() at the start of your script.
7+
8+
The Colorama module offers three main formatting options: Fore, Back, and Style. These allow us to change the foreground or background text color and style. The colors available for the foreground and background are black, red, green, yellow, blue, magenta, cyan, and white.
9+
10+
## 📌Print Colored Text with Python
11+
Traditionally, printing full-colour text to the terminal is accomplished by a series of escape characters on Linux or OS X systems. However, this will not work for Windows operating systems. Now let’s see how to print coloured text with Python using the Colorama module:
12+
13+
**Code**
14+
15+
import colorama
16+
from colorama import Fore,Back,Style
17+
colorama.init()
18+
print(Fore.GREEN+"HELLO FRIENDS WELCOME TO OUR CODING BUDDIES CHANNEL")
19+
print(Back.BLUE+"Hi Friends my name Kishan")
20+
print(Fore.RED+Back.GREEN+"This Is Our Coding Buddies Channel")
21+
print(Style.BRIGHT+"Do Like Share And Subscribe")
22+
**Output**
23+
24+
25+
It is also possible to change other text properties using ANSI escape characters, for example, if we wanted to make the text darker or lighter.
26+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /