Skip to main content

Lightweight package for colored text in python.

Project description

Usage

Usage Params Return Value
ansiprint() str: msg, str: color-name/ansi, str: end, boolean: flush str: msg
ansi() str: color-name/ansi str: ansi
clear() None: None None: None

Examples


ansiprint()

Code:

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

Result: 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: 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: result


Ansi Chart

ansi chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AnsiPrint-0.0.7.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

AnsiPrint-0.0.7-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page