A Python module to implement tml, which make the output of coloured/formatted text in the terminal easier and more readable.
First, install tmlpy:
pip install tmlpy
The output of coloured/formatted text is easy using the following syntax:
from tmlpy import tml
tml.print("<red>this text is <bold>red</bold></red> ", "and the following is <green>%s</green>" % "not red", sep='')
Each tag is enclosed in angle brackets, much like HTML.
You can nest tags as deeply as you like.
It's not required to close tags you've opened, though it can make for easier reading.
<red>
<green>
<yellow>
<blue>
<magenta>
<cyan>
<lightgrey>
<darkgrey>
<black>
<white>
<lightred>
<lightgreen>
<lightyellow>
<lightblue>
<lightmagenta>
<lightcyan>
<bg-red>
<bg-green>
<bg-yellow>
<bg-blue>
<bg-magenta>
<bg-cyan>
<bg-lightgrey>
<bg-darkgrey>
<bg-black>
<bg-white>
<bg-lightred>
<bg-lightgreen>
<bg-lightyellow>
<bg-lightblue>
<bg-lightmagenta>
<bg-lightcyan>
<bold>
<dim>
<underline>
<blink>
<reverse>
<hidden>