I have already read the questions about how coloring text with Python and the Colorama package but I didn't find what I was looking for.
I have some raw text:
Impossible considered invitation him men instrument saw celebrated unpleasant. Put rest and must set kind next many near nay. He exquisite continued explained middleton am. Voice hours young woody has she think equal.
And two lists of words:
good = ["instrument", "kind", "exquisite", "young"]
bad = ["impossible", "unpleasant", "woody"]
I would like to print that text in a terminal so that words in good
are displayed in green and words in bad
are displayed in red.
I know I could use colorama, check each word sequentially and make a print statement for this word but it doesn't sound like a good solution. Is there an effective way to do that?