如何在jupyter笔记本中将python字符串显示为HTML

jko*_*ian 12 html python ipython python-3.x jupyter-notebook

在IPython笔记本中,我曾经能够通过使用HTMLIPython显示模块中的函数显示包含html作为实际html的python字符串.

from IPython.display import HTML
Run Code Online (Sandbox Code Playgroud)

在jupyter笔记本中,显示模块不再存在.有谁知道我在哪里可以找到HTML功能?

我使用Jupyter笔记本4.1,IPython 4.0.2和Python 3.5.1 64位

小智 14

使用该功能 display

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

bar()
Run Code Online (Sandbox Code Playgroud)

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