TJ1
TJ1

Reputation: 8468

Python: display IFrame

I am trying a sample code that is supposed to use IPython and display a html file. Here is part of the code that is relevant to my question:

from IPython.display import IFrame
from IPython.core.display import display

display(IFrame('myfile.html', '100%', '600px'))

But when I run it, nothing shows up. What could be the reason?

Do I need to install something related to d3 or d3js?

Upvotes: 4

Views: 9925

Answers (1)

Pierz
Pierz

Reputation: 8088

Your code works in a Jupyter notebook (it doesn't display anything when tested in a terminal running IPython) - It will not display anything if the file is empty or contains malformed HTML. If the file doesn't exist you'll see a 404 displayed in the IFrame.

Upvotes: 0

Related Questions