Can Output widget capture IFrame?

I have

out = widgets.Output()
@out.capture()
def render():
    IPython.display.IFrame(src='file.html',width=900, height=600)

The last line works fine by itself without the Output widget, but when i do out in a separate cell in the Jupyter notebook, nothing is shown?

I think you need to import and call the display function like this:

import ipywidgets as widgets
from IPython.display import display, IFrame

out = widgets.Output()

@out.capture()
def render():
    display(IFrame(src='file.html',width=900, height=600))
2 Likes

It works! Thank you!