Ask Your Question
0

Printing in different colors in notebook

asked 2012-12-07 15:46:09 +0200

G-Sage gravatar image

updated 2012-12-07 15:46:17 +0200

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

Comments

John Palmieri gravatar imageJohn Palmieri ( 2012-12-07 17:00:15 +0200 )edit
1

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 17:05:01 +0200 )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 17:57:24 +0200 )edit

@kcrisman Okay, thanks I will try that out.

G-Sage gravatar imageG-Sage ( 2012-12-07 17:57:37 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-12-08 22:11:42 +0200

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

Stats

Asked: 2012-12-07 15:46:09 +0200

Seen: 1,500 times

Last updated: Dec 08 '12