First time here? Check out the FAQ!

Ask Your Question
3

Frames in interacts

asked 14 years ago

mhampton gravatar image

Is there a way to split the output of an interact into frames (html frames)? In particular I would like to be able to get the contents of a webpage (with urllib2 for example) and display it in a frame alongside other sorts of output.

Preview: (hide)

Comments

You can also try CSS frames.

ccanonc gravatar imageccanonc ( 14 years ago )

1 Answer

Sort by » oldest newest most voted
5

answered 14 years ago

Mike Hansen gravatar image

It's easier to have the user's browser do the work if possible. I'm not sure what your specific use case is, but here is an interact which will load a page in a frame:

def iframe(url):
    html('<iframe src="%s" style="width: 100%%; height: 400px;"></iframe>'%(url))

@interact
def _(url='http://www.google.com'):
    iframe(url)
Preview: (hide)
link

Comments

Very Nice!

William Stein gravatar imageWilliam Stein ( 14 years ago )

Thanks, that helps. What I'd really like to do is have some web content in one frame, and Sage stuff in the other (for example, a 2d or 3d plot). Using <frameset> and your example I can get two webpages side by side, but not the Sage output (unless its html friendly).

mhampton gravatar imagemhampton ( 14 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 14 years ago

Seen: 496 times

Last updated: Aug 26 '10