是否可以将渲染的HTML输出嵌入到iPython输出中?
一种方法是使用
from IPython.core.display import HTML
HTML('<a href="http://example.com">link</a>')
Run Code Online (Sandbox Code Playgroud)
或(IPython多线单元别名)
%%html
<a href="http://example.com">link</a>
Run Code Online (Sandbox Code Playgroud)
哪个返回格式化的链接,但是
HTML()在列表或pandas打印表格中渲染对象.你可以做df.to_html(),但没有在细胞内建立链接.如何克服这些缺点并使iPython输出更具交互性?