Skip to content

Instantly share code, notes, and snippets.

@MITsVision
Created November 25, 2019 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MITsVision/d986a9c6d5bb2f25d20c72bc0c543c06 to your computer and use it in GitHub Desktop.
Save MITsVision/d986a9c6d5bb2f25d20c72bc0c543c06 to your computer and use it in GitHub Desktop.
easy way to print different colors in jupyter notebook cells
from IPython.display import HTML as html_print
def cstr(s, color='black'):
return "<text style=color:{}>{}</text>".format(color, s)
left, word, right = 'left print' , 'center print' , 'right print'
html_print(cstr(' '.join([left, cstr(word, color='green'), right]), color='black') )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment