Ask Your Question

Printing in different colors in notebook

asked 2012-12-07 08:46:09 -0600

G-Sage gravatar image

updated 2012-12-07 08:46:17 -0600

That's it. Instead of

print "Hello world"

and getting the output in the standard blue (in the notebook), I want to have a different color sometime. Is this possible? Much love.

edit retag flag offensive close merge delete


John Palmieri gravatar imageJohn Palmieri ( 2012-12-07 10:00:15 -0600 )edit

Don't forget you can also use `%html` in the notebook for full styling, or maybe the `html()` command will be useful as well...

kcrisman gravatar imagekcrisman ( 2012-12-07 10:05:01 -0600 )edit

@john I'm mostly talking about that I want one line to print in red and the next to print in green and all that. I want that kind of control. It looks like the answer in that question tells you how to change the color for one cell, not for one line of printing.

G-Sage gravatar imageG-Sage ( 2012-12-07 10:57:24 -0600 )edit

@kcrisman Okay, thanks I will try that out.

G-Sage gravatar imageG-Sage ( 2012-12-07 10:57:37 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2012-12-08 15:11:42 -0600

Jason Grout gravatar image

How about:

html("""<font color='red'>hi</font><br/>
<font color='blue'>bye</font>""")
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-12-07 08:46:09 -0600

Seen: 1,085 times

Last updated: Dec 08 '12