[IPython-User] ipython Notebook html issue

Brian Granger ellisonbg@gmail....
Thu Apr 12 13:27:54 CDT 2012


This is a css issue.  These cells have a clean css stylesheet so you will
need to add your own styling.

Cheers,

Brian

On Wed, Apr 11, 2012 at 1:55 PM, Krishna Kumar <krishnakumar85@gmail.com>wrote:

> Hi,
>
> I have been working on ipython for around a week and it is very nice. I
> have installed the ipython 0.13b (dev). The new notebook interface is very
> cool and impressive. I tried this out:
>
> [code]
> from IPython.core.display import HTML
>
> class A(HTML):
>     def __init__(self):
>         self.wrong = 3
>         self.correct = 5
>
>     def calc(self):
>         self.wrong += 2
>         self.correct -= 1
>
>     def _repr_html_(self):
>         return "<i>wrong</i><b>%i</b><i>correct</i><b>%i</b>"%(self.wrong,
> self.correct)
>
> A()
> [/code]
>
> When the code is executed, the output is not html, it displays as
> "wrong3correct5"* *(But when the same is pasted in this email, it
> displays properly...* **wrong**3**correct**5*, which indicates that the
> browser is not rendering the italics and the bold properly).
>
> When I tried with:
> [code]
> return
> "<table><tr><td>wrong</td><td>%i</td></tr><tr><td>correct</td><td>%i</td></tr></table></b>"%(self.wrong,
> self.correct)
> [/code]
> It shows:
> Out[4]: (in table)
> wrong3correct5
>
> What could be the issue?
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>


-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120412/0157d062/attachment.html 


More information about the IPython-User mailing list