Is it somehow possible to have certain output appear in a different color in the IPython Notebook? For example, something along the lines of:
print(\"Hello
Here's a quick hack:
from IPython.display import HTML as html_print
def cstr(s, color='black'):
return "{} ".format(color, s)
left, word, right = 'foo' , 'abc' , 'bar'
html_print(cstr(' '.join([left, cstr(word, color='red'), right]), color='black') )
[out]:
If you just want a single color: html_print(cstr('abc', 'red'))