Wednesday, January 4, 2017

Outputing HTML Ipython object to disk

Leave a Comment

How can I output an IPython HTML object of the form <IPython.core.display.HTML object> to a HTML file or PDF file on disk?

1 Answers

Answers 1

You can do something like this:

from IPython.core.display import HTML  a = HTML('<a href="http://example.com">LINK TO THE WEB PAGE</a>') html = a.data with open('html_file.html', 'w') as f:     f.write(html) 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment