Skip to content Skip to sidebar Skip to footer

How To Display A Python String As Html In Jupyter Notebook

In IPython notebook, I used to be able to display a python string that contains html as actual html, by using the HTML function from IPython's display module. from IPython.display

Solution 1:

Use the function display

def bar():
    from IPython.display import display, HTML
    chart = HTML('<h1>Hello, world!</h1>')
    # or chart = charts.plot(...)
    display(chart)

bar()

source: http://suanfazu.com/t/jupyter-highcharts/13438/2

Post a Comment for "How To Display A Python String As Html In Jupyter Notebook"