4

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?

ctrl-alt-delor
  • 7,506
  • 5
  • 40
  • 52
TJ1
  • 7,578
  • 19
  • 76
  • 119
  • If you start an Ipython notebook and enter any input do you get output? If not, then you have a firewall problem, that is unrelated to your code. This is typical when using it for the first time... – Woody Pride Mar 25 '14 at 04:19
  • Woody: I do not use Ipython notebook, I just use IDLE (Python GUI). – TJ1 Mar 28 '14 at 14:32

1 Answers1

0

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.

Pierz
  • 7,064
  • 52
  • 59