Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Print Color Highlighted Strings To Unix Terminal

DZone's Guide to

Print Color Highlighted Strings To Unix Terminal

·
Free Resource
Sample of escape sequences needed to print in color to unix/linux terminal.


print x.replace('toostis', '\033[0;31mtoostis\033[m')


This will highlight all 'toostis' instances in x with red.
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}