Is it possible to embed rendered HTML output into iPython output?
One way is to use
from IPython.core.display import HTML
HTML('link')
or (IPython multiline cell alias)
%%html
Which return a formatted link, but
This link doesn't open a browser with the webpage itself from the console. IPython notebooks support honest rendering, though.
I'm unaware about how to render HTML() object within, say, a list or pandas printed table. You can do df.to_html(), but without making links inside cells.
This output isn't interactive in the PyCharm Python console (because it's not QT).
How can I overcome thes shortcomings and make iPython output a bit more interactive?
解决方案
This seems to work for me:
from IPython.core.display import display, HTML
display(HTML('
Hello, world!
'))The trick is to wrap it in "display" as well.