Motivation 希望高亮突出显示文本数据中的某些片段,这些片段可能是某些任务的gold standard,在做错误分析时,想高亮显示,以便对比预测结果与truth之间的差异。 Solution Python 3.X from termcolor import colored print(colored('hello', 'red'), colored('world', 'green')) Result: Reference How to print colored text in Python?