Is it possible to embed rendered HTML output into IPython output?
One way is to use
from IPython.core.display import HTML
HTML('<a href="http://example.com">link</a>')
or (IPython multiline cell alias)
%%html
<a href="http://example.com">link</a>
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 of 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 these shortcomings and make IPython output a bit more interactive?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…