From 56d515ca3f1a85604621feb78d9c5ff6819b1569 Mon Sep 17 00:00:00 2001 From: Nitkarsh Chourasia Date: Tue, 9 Jan 2024 19:38:53 +0530 Subject: [PATCH] add: colorma library experimentation Learning about the concept of ANSI and mac and unix systems with windows32 api call. --- colorma_as_color.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 colorma_as_color.py diff --git a/colorma_as_color.py b/colorma_as_color.py new file mode 100644 index 00000000000..9bf2338ebbb --- /dev/null +++ b/colorma_as_color.py @@ -0,0 +1,22 @@ +import colorama as color + + +from colorama import Fore, Back, Style + +print(Fore.RED + "some red text") +print(Back.GREEN + "and with a green background") +print("So any text will be in green background?") + +print("So is it a wrapper of some sort?") +print("dark_angel wasn't using it in her code.") +print("she was just being using direct ANSI codes.") +print(Style.RESET_ALL) +print(Fore.BRIGHT_RED + "some bright red text") +print(Back.WHITE + "and with a white background") +print("Will need to study about what is ANSI codes.") +print(Style.DIM + "and in dim text") +print(Style.RESET_ALL) +print("back to normal now") + + +# …or, Colorama can be used in conjunction with existing ANSI libraries such as the venerable Termcolor the fabulous Blessings, or the incredible _Rich. \ No newline at end of file