AnsiPrint - Coloured text made easy.
ChezCoder (1606)

Installation

ENTER THIS IN THE CONSOLE:

import os
os.system("pip install AnsiPrint")

USE IT LIKE THIS IN THE CODE:

import AnsiPrint

CHECK IT OUT ON PYPI: AnsiPrint

Usage

Note: For people who don't like reading the docs, this package is just colorama and termcolor squished into two functions.

UsageParamsReturn Value
ansiprint()str: msg, str: color-name/ansi, str: endstr: msg
ansi()str: color-name/ansistr: ansi
clear()None: NoneNone: None

Examples


ansiprint()

Code:

ansiprint("This is red!","red")
ansiprint("This is blue!","blue")
ansiprint("This is white and ends with \"!\"",end="!")

Result:


ansi()

Code:

print(ansi("red") + "This is red!" + ansi("reset"))
print(ansi("blue") + "This is blue!" + ansi("reset"))
print(ansi(34) + "This is the ansi \"34\"!" + ansi("reset")) # ansi codes are in the ansi chart below

Result:


clear()

Code:

print("This message isn't seen because the console is cleared after!")
clear()
print("This message is seen because it is after the console is cleared!")

Result:


Ansi Chart

This was made for the community; use it in any project you want, no credit needed :)

@Warhawk947 visit count: 3
You are viewing a single comment. View All
ChezCoder (1606)

@BobNeo of course! This was meant for the community to use! Use it in any project your heart desires :)