Simple package to print text to terminal with colors and alignment
Project description
printplus
Simple package to print text to terminal with colors and alignment
Classes Available:
-
PrintPlusMethods in the class:
-
text( message : str)
Add text to print, can be called multiple times to add text to previous message -
red()
Adds red color to text added before the call which does not already have color -
green()
Adds green color to text added before the call which does not already have color -
blue()
Adds blue color to text added before the call which does not already have color -
yellow()
Adds yellow color to text added before the call which does not already have color -
violet()
Adds violet color to text added before the call which does not already have color -
bold()
Makes all the text added before the call bold -
highlight()
Highlights all the texts, even those added after the call -
underline()
Underkines all the texts, even those added after the call -
blanks( char : chr)
Specify with what char to spill the blanks. By default it will be filled by spaces -
show()
Prints the constructed text and clears all the values stored -
center() and right()
Aligns the text as specified, the one thats called latest will be applied -
end()
Sepcify the end char of text, by default it will be \n , the one thats called latest will be applied -
getColored(message:str,color:str)
Returns colored string to use in other methods, the argument color can be one of:
- PrintPlus().colors['RED']
- PrintPlus().colors['GREEN']
- PrintPlus().colors['VIOLET']
- PrintPlus().colors['BLUE']
- PrintPlus().colors['YELLOW']
- PrintPlus().colors['BOLD']
- PrintPlus().colors['UNDERLINE']
- PrintPlus().colors['HIGHLIGHT']
-
Usage:
from printplus import PrintPlus
printer = PrintPlus()
printer.text('Hello').green().text('World!!').red().underline().text(' by printplus').yellow().center().bold().show()
Try:
pip3 install printplus
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file printplus-1.tar.gz.
File metadata
- Download URL: printplus-1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c8e05133cce29c7286d1ca00639670c161e32adade05d165d989360711c263a
|
|
| MD5 |
7d47a46e1e236ad172094eb090741d32
|
|
| BLAKE2b-256 |
bb9f192b3cd9844efbd211f49b745906fffe055be1bef6d36174399312c35855
|