Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

PyPIPython

termicol

A python Simple python function aimed to handle printing of colored and / or decorated text to console / terminal.


Installation

With gitGitHub:

git clone https://github.com/irtsa-dev/termicol.git

With pipPyPi

pip install idev-termicol






Usage

To import:

fromtermicol.termicolimport*

Then, later on you may utilize:

tprint(content: str, end: str='\n')
# Prints off text and background in the given color with provided decorations.# To do so, <> is used similar to html.# Example being: <t=white>helloshowColorList()
# Prints off a list of valid arguments for color.showDecorationList()
# Prints off a list of valid arguments for decoration.



Code Examples

fromtermicol.termicolimporttprinttprint("<t=red>hello, this text will be red!")
fromtermicol.termicolimport*tprint("<t=blue>this text will be blue,<t=red> While this text will be red!")
fromtermicol.termicolimport*tprint("<t=red><b=blue><d=underline>This will be underlined red text with blue background!")
fromtermicol.termicolimport*tprint("<t=red><b=blue>This will be red text with a blue background!<r>This will now be the default text.<t=red> Back to red text!<b=white> A blue backround is added.<r=b> Background is now default.")



Additional Notes

Valid tags to utilize:

  • t | textcolor
    • Will change the text color, can either be one of the valid color arguments that are seen in showColorList() function or a list of 3 values separated by a comma for rgb values.
    • <t=red> | <t=20,2,30>
  • b | bgcolor | backgroundcolor
    • Will change the background color, can either be one of the valid color arguments that are seen in showColorList() function or a list of 3 values separated by a comma for rgb values.
    • <b=red> | <b=20,2,30>
  • d | deco | decorations
    • Will add in decorations based on what is provided, must be ones provided in the showDecorationList() function.
    • <d=underline> | <d=underline,italic>
  • r
    • Will reset back to default, you can also specify what to reset and provide a list (but only accepts t,b,d).
    • <r> | <r=td>
  • nl
    • Indicates a newline (basically doing \n)
    • <nl>

About

A python Simple python function aimed to handle printing of colored and / or decorated text to console / terminal.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages