Skip to content

This module can colorize any text in your terminal

Notifications You must be signed in to change notification settings

tankalxat34/PaintPrint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaintPrint

Downloads Downloads Downloads Supported Versions Version GitHub Repo stars

This module can colorize any text in your terminal

github PyPi


Author: tankalxat34

Installing

pip install PaintPrint

Quick start

Hello world

This is a simple hello world:

from PaintPrint import *

bprint("Hello world!", 
       FORMATTING.BOLD, 
       FOREGROUND.RED, 
       BACKGROUND.GREEN)

In your console you can see something like this:

Unreadable symbols

If you see incomprehensible symbols instead of colors in the console, perform this function at the beginning of your code:

from PaintPrint import *
neutralizeColorProblem()

Templates

In this module you can use some templates for beautiful print on terminal:

from PaintPrint import *

bprint("TEMPLATES", 
       FORMATTING.BORDERED, 
       FORMATTING.BOLD, 
       FOREGROUND.MAGENTA, 
       BACKGROUND.WHITE)

print("Template for links: " + bformat("python.org", TEMPLATE.URL))
bprint("This is a `positive` template", TEMPLATE.POSITIVE)
bprint("\tAnd this is a `negative`", TEMPLATE.NEGATIVE)
print("You also can write " + bformat("yes", TEMPLATE.YES) + " and " + bformat("no", TEMPLATE.NO) + " like here")
print("If you like " + bformat("black and white", TEMPLATE.BLACKWHITE1) + " or " + bformat("white and black", TEMPLATE.BLACKWHITE2) + " you can using special templates!")

Result:

All functions

Open test file and perform in your PC. You will see something like this: